Neocortex 🧠

Search

Search IconIcon to open search

Selection Sort

Last updated Dec 21, 2021 Edit Source

Selection sort is a sorting algorithm based on Priority Queues. In order to sort using selection sort, the items are inserted into a priority queue with their values as keys in the order they are currently at (i.e. not altering the order, meaning each insertion takes $O(1)$ time and $O(n)$ time in total). Afterwards, items are removed from the priority queue, since the order hasn’t changed, this operation takes $O(n^2)$.


Interactive Graph