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.
The solution I posted uses the built in sort method that Java has. That built in method runs in O(n log(n)) by performing a dual pivot quicksort on the collection. For the comparison used in that sort, I wrote my own string comparison method that runs in worst case the length of one of the strings. O(n log(n)) is a aproximation the absolute would be O(SumOfStrings log n).
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 →
The solution I posted uses the built in sort method that Java has. That built in method runs in O(n log(n)) by performing a dual pivot quicksort on the collection. For the comparison used in that sort, I wrote my own string comparison method that runs in worst case the length of one of the strings. O(n log(n)) is a aproximation the absolute would be O(SumOfStrings log n).