CJCoding With Joseph
15free / daySign inCreate account

Build Selection Sort From Its Helper

NumberList gives you two finished helpers: findMinIndex(int start), which returns the INDEX of the smallest value from start onward, and a private swap(int i, int j).

Requirements:
1. Complete selectionSort() so the list ends up in ascending order.
2. For each position i, find the index of the smallest remaining value and swap it into position i.
3. findMinIndex returns an index, not a value - never store its result into the array.

Do NOT write a main method.

Expected Output:

List: 4 9 2 7 5
List: 2 4 5 7 9
0
5

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Data Structures & AlgorithmsSorting
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.