There is an array of size N, randomly filled with 0, 1 and 2. How you can sort it efficiently, preferably O(n).
i'll use counting sort...as this array is filled with only 0 1 and 2 .. so space will be constant
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks