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.
I used Java's built in Arrays.sort() method along with a custom comparator. Java's sort function is implemented using a dual pivot quicksort that helps to reduce worse case runtimes. If you are determined to implement your own quicksort I suggest you look into how to reduce worst case runtime by changing how you choose your pivot.
It is also worth noting that if you are coding this in Java you should look into using StringBuilder for you output as often times this can cut unamortized runtime in half or more.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →