Sort Algorithm - Selection Sort
Last updated on September 4, 2023 pm
Definition:
Selection sort is a simple comparison-based sorting algorithm that repeatedly selects the minimum element from the unsorted part of the array and places it at the beginning. It works by dividing the input array into two parts: the sorted and the unsorted portions. While straightforward, it has a time complexity of O(n^2), making it inefficient for large datasets.
Code:
1 |
|
Sort Algorithm - Selection Sort
http://hihiko.zxy/2023/09/04/Sort-Algorithm-Selection-Sort/