Neocortex 🧠

Search

Search IconIcon to open search

Insertion Sort

Last updated Dec 21, 2021 Edit Source

Insertion sort, is an algorithm based on Priority Queues. In insertion sort, you insert the elements that you want to sort into the priority queue in a sorted order. This operation takes $O(n)$ time for each insertsion(unless a Heap is used), and removing elements takes $O(1)$ time(again, unless the queue is implemented with a heap). In total, the big-oh complexity of this algorithm is $O(n^2)$

Image


Interactive Graph