Time complexity of binary search: O(log n) — halves search space each step
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)
merge sort: O(n log n) always
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
Graph (abstract data type)
Time complexity of BFS and DFS: O(V + E)
Best, worst and average case
Quicksort's average time complexity is O(n log n)
Hash table
Hash table lookup: O(1) average time complexity
One email a day: 5 concepts + the 5 stories that matter →
Swipe through 100 ML concepts daily
Open TickerNews