In this article, we have explained the time complexity of Counting Sort for Average case, Worst case and Best case and also, covered the space complexity using Mathematical analysis.
Table of contents:
Introduction to Counting SortTime Complexity analysisWorst case time complexityBest case time complexityAverage case time complexitySpace ComplexityConclusion on time and space complexityComparison with other sorting algorithms
In short,
Time complexity: O(N+K)Space Complexity: O(K)Wor...
Published on June 10, 2021 02:09