Courses / Computer Science I
Algorithmics

Sorting Strategies

Computer Science I 169 words Free to read

Why Sort?

Sorting arranges data into order, making searching, grouping, and deduplication trivial.

CategoryComplexityKey Algorithms
SimpleO(n2)O(n^2)Bubble, Selection, Insertion
EfficientO(nlogn)O(n \log n)Merge, Quicksort, Heapsort

Efficient Sorts & Stability

Stability preserves the relative order of equal elements. Merge sort is stable; Quicksort usually is not.

Pitfall: O(nlogn)O(n \log n) is the comparison lower bound (Ω(nlogn)\Omega(n \log n)). However, Insertion sort can beat efficient sorts on small inputs due to low overhead.
Sorting Strategies

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes

Algorithmics