← Back to Data Structures & Algorithms
Question 453
Build Selection Sort From Its Helper
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 privateswap(int i, int j). Requirements: 1. CompleteselectionSort()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
Sign in to use hintsTopics:
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.