3 ms·
That's reasonable to me if that's the standard. The reason I jumped to quicksort in my initial reply is any sort short of quick or merge sort (or some other nl
by fossuser 6y ago
That's reasonable to me if that's the standard.
The reason I jumped to quicksort in my initial reply is any sort short of quick or merge sort (or some other nlogn variant) would fail you at FAANG.
You could do the naive n^2, but it better only be in the first two min and hand waved off as obviously inefficient, almost a joke that you implemented it at all on the way to writing the nlogn version, bonus points if you talk about how merge sort is nlogn in worst case and quicksort is n squared in the worst case, but in practice often faster.