What is the time complexity of the comb sort algorithm?

Sorting Algorithms Questions Medium



80 Short 66 Medium 49 Long Answer Questions Question Index

What is the time complexity of the comb sort algorithm?

The time complexity of the comb sort algorithm is O(n^2) in the worst case scenario. However, in the average case, it has a time complexity of O(n^2/2^p), where p is the number of increments used in the algorithm. The best case time complexity is O(n log n) when the input array is already sorted.