Challenge: Implement Selection Sort

Selection sort loops over positions in the array. For each position, it finds the index of the minimum value in the subarray starting at that position. Then it swaps the values at the position and at the minimum index. Write selection sort, making use of the swap and indexOfMinimum functions. 

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy