PRG/421 Week 5 Java 5.20 LAB: Descending selection sort with output during execution

$ 7

PRG/421 Week 5 Java 5.20 LAB: Descending selection sort with output during execution

Write a void method selectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The method should use nested loops and output the array after each iteration of the outer loop, thus outputting the array N-1 times (where N is the size). Complete the main() to read in a list of up to 10 positive integers (ending in -1) and then call the selectionSortDescendTrace() method.

If the input is:
20 10 30 40 -1

then the output is:
40 10 30 20
40 30 10 20
40 30 20 10

993 in stock

SKU: PRG421WK5LAB5P20 Category:

Description

PRG/421 Week 5 Java 5.20 LAB: Descending selection sort with output during execution

Write a void method selectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The method should use nested loops and output the array after each iteration of the outer loop, thus outputting the array N-1 times (where N is the size). Complete the main() to read in a list of up to 10 positive integers (ending in -1) and then call the selectionSortDescendTrace() method.

If the input is:
20 10 30 40 -1

then the output is:
40 10 30 20
40 30 10 20
40 30 20 10

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.