## Notes A *comparison-based* algorithm. Find the smallest element from the unsorted portion and swap it with the first unsorted element. ## Methodology In an unsorted array, start with the element at index = 0 1. Find the smallest item in the rest of the array, and swap with the element at index = 0 2. Move to index = 1, find the smallest item in the rest of the array, and swap with element at index = 1 3. Repeat until sorted ## Analysis - [[Time Complexity]] is O(n^2) because there are two nested loops - [[Space Complexity]] is O(c) because a constant number of temporary variables are needed - Not a *stable* sort, meaning that the positions of equal elements are not guaranteed - Slower than [[Quick Sort]] and [[Merge Sort]] - Suitable for - Small lists where overhead of complex algorithms are not justified - When memory writing is not costly--it requires less memory writes