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 best sorting algorithm is done in O(nlogn) time; eg library Array.Sort() in C# uses a quicksort alg I beleive. The original problem can be solved in linear time, ie O(n). Therefore sorting would decrease performance as your # of students (n) increased.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
The best sorting algorithm is done in O(nlogn) time; eg library Array.Sort() in C# uses a quicksort alg I beleive. The original problem can be solved in linear time, ie O(n). Therefore sorting would decrease performance as your # of students (n) increased.