Skip to content
Related Articles

Related Articles

Time Complexities of all Sorting Algorithms

Improve Article
Save Article
Like Article
  • Difficulty Level : Easy
  • Last Updated : 28 Feb, 2022

The efficiency of an algorithm depends on two parameters:

1. Time Complexity

2. Space Complexity

Time Complexity: Time Complexity is defined as the number of times a particular instruction set is executed rather than the total time is taken. It is because the total time taken also depends on some external factors like the compiler used, processor’s speed, etc.

Space Complexity: Space Complexity is the total memory space required by the program for its execution.

Both are calculated as the function of input size(n).

One important thing here is that in spite of these parameters the efficiency of an algorithm also depends upon the nature and size of the input. 

Following is a quick revision sheet that you may refer to at the last minute 


AlgorithmTime Complexity 
Selection SortΩ(n^2)θ(n^2)O(n^2) 
Bubble SortΩ(n)θ(n^2)O(n^2) 
Insertion SortΩ(n)θ(n^2)O(n^2) 
Heap SortΩ(n log(n))θ(n log(n))O(n log(n)) 
Quick SortΩ(n log(n))θ(n log(n))O(n^2) 
Merge SortΩ(n log(n))θ(n log(n))O(n log(n)) 
Bucket SortΩ(n+k)θ(n+k)O(n^2) 
Radix SortΩ(nk)θ(nk)O(nk) 
Count SortΩ(n+k)θ(n+k)O(n+k) 

Also, see:  

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!