Overview of Sorting Algorithms

Here's a quick summary of the time complexity of sorting algorithms.

Here’s a quick table that you can refer to when you are solving coding problems!

Insertion Selection Merge Quick Sort
Best Case O(n)O(n) O(n2)O(n^2) O(nlog(n))O(nlog(n)) O(nlog(n))O(nlog(n))
Average Case O(n2)O(n^2) O(n2)O(n^2) O(nlog(n))O(nlog(n)) O(nlog(n))O(nlog(n))
Worst Case O(n2)O(n^2) O(n2)O(n^2) O(nlog(n))O(nlog(n)) O(n2)O(n^2)

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.