3.49 Selection Sort Array
3.49.1 Problem Metadata
- Platform: Firecode.io
- Problem ID: Selection Sort Array
- Difficulty: Level 2
- URL: https://www.firecode.io/courses
- Tags:
- Techniques: Sorting, Array
3.49.2 Description
Given an integer array, sort it in ascending order using the selection sort algorithm.
3.49.5 Solution - Iterative Selection
3.49.5.1 Walkthrough
Selection sort repeatedly selects the smallest remaining element and swaps it into the next output position. For each index i, scan the suffix [i, n) to find the minimum value and swap it with arr[i].