We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
if observed carefully N (array size i.e. 1000000) is grater than X (Range of array elements i.e. -10000<= A[i] <= 10000).
so i will suggest count sort. always gives complexity(O(X)) = 1/2* O(X).
Find the Median
You are viewing a single comment's thread. Return to all comments →
if observed carefully N (array size i.e. 1000000) is grater than X (Range of array elements i.e. -10000<= A[i] <= 10000). so i will suggest count sort. always gives complexity(O(X)) = 1/2* O(X).
saves a lot of time..