Understanding selection sort algorithm
The strategy from the earlier example could be used to create an algorithm. To explain this algorithm, we will take an array as an input list, but the same algorithm can be applied to any list data structure.
Algorithm
Similar to bubble sort, selection sort algorithm conceptually divides the array into two parts: a sorted subarray and an unsorted subarray. Initially, all elements belong to the unsorted portion, while the sorted portion is empty.
Liking the course? Check our discounted plans to continue learning.