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.
it is taking a lot of time than alloted time by compiler(online)
so use mergesort instead of quicksort
[ quick has worsttime complexity of O[n^2] due to selction of pivot]
mergesort has O[nlogn]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Median
You are viewing a single comment's thread. Return to all comments →
it is taking a lot of time than alloted time by compiler(online) so use mergesort instead of quicksort [ quick has worsttime complexity of O[n^2] due to selction of pivot] mergesort has O[nlogn]