Computer Science

Sorting Algorithms

Counting Sort

     

Let nn be the size of an input array made up of positive integers and suppose that your algorithm is given VmaxV_{max}, the maximum value of all elements within the input array. Which of the following describes the correct space complexity of counting Sort in this case?

Suppose we have an array with nn elements and kk 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))k = O(f(n)) means kk is bounded by the function f(n)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...