Insertion sort
Quote
“Program construction consists of a sequence of refinement steps.” — Niklaus Wirth
Case | Time complexity | Space complexity |
---|---|---|
Best | \(\color{black} \fcolorbox{gold}{yellow} {Ω(n)}\) | |
Average | \(\color{white} \fcolorbox{crimson}{firebrick} {Θ(n^2)}\) | |
Worst | \(\color{white} \fcolorbox{crimson}{firebrick} {O(n^2)}\) | \(\color{white} \fcolorbox{limegreen}{forestgreen} {O(1)}\) |
Simple to implement and sufficient for smaller data sets.
Note
A work in progress, check back later for more content.