Merge sort consistently performs at O(n log n) time complexity for any input size
Image: Rob Glover from Bradford, UK, CC BY-SA 2.0, via Wikimedia Commons
Merge sort consistently performs at O(n log n) time complexity for any input size
O(n log n) is the lower bound for comparison-based sorting
O(n log n) is the lower bound because each of n elements must be compared at least log n times to ensure all permutations are considered
Best, worst and average case
Quicksort's average time complexity is O(n log n)
Binary search
Time complexity of binary search: O(log n) — halves search space each step
Dijkstra's algorithm
Dijkstra's algorithm time complexity: O((V+E) log V)
Hash table
Hash table lookup: O(1) average time complexity
Graph (abstract data type)
Time complexity of BFS and DFS: O(V + E)
One email a day: 5 concepts + the 5 stories that matter →
Swipe through 100 ML concepts daily
Open TickerNews