Waste less time on Facebook — follow Brilliant.
Computer Science

Sorting Algorithms

Counting Sort


Let \(n\) be the size of the input array and let \(V_{max}\) and \(V_{min}\) be the maximum and minimum elements within the input array respectively. Which of the following describes the correct space complexity of counting Sort?

Suppose we have an array with \(n\) elements and \(k\) is the size of the largest key. When would it be a bad idea to use counting sort to sort this array?

Details and assumptions

\(k = O(f(n))\) means \(k\) is bounded by the function \(f(n)\).

Assume we want to sort an array of ints. In which scenario is the use of counting sort the most sensible?


Problem Loading...

Note Loading...

Set Loading...