You are viewing a single comment's thread. Return to all comments →
I tried this using the Quick Select algorithm but I made the partitions using Hoare's partioning algorithm rather than lomuto and it timed out.
Now I tried it using lomuto and all cases passed with test case #4 taking the longest which was 0.01 seconds.
I wonder why Hoare's took longer...it's supposed to have much fewer comparisons...about 1/3rd.
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 →
I tried this using the Quick Select algorithm but I made the partitions using Hoare's partioning algorithm rather than lomuto and it timed out.
Now I tried it using lomuto and all cases passed with test case #4 taking the longest which was 0.01 seconds.
I wonder why Hoare's took longer...it's supposed to have much fewer comparisons...about 1/3rd.