Big-O notation
Big-O describes growth in the worst case, ignoring constants: .
Big-O describes growth in the worst case, ignoring constants: .
Merge sort is O(n log n) always; quicksort is O(n log n) on average but O(n²) worst case; bubble sort is O(n²).
Halving a sorted array each step gives comparisons. It is naturally recursive.