3 ms·
Any of the non-comparison sorts (radix, bucket, etc) would be good since he specified the elements are integers.
by tlrobinson 19y ago
Any of the non-comparison sorts (radix, bucket, etc) would be good since he specified the elements are integers.
- aston 19y agoNot necessarily. The problem's rather underconstrained, but under reasonable asusumptions about memory allocation, you might actually get better performance from a quick sort, since the algorithm works with a lot of locality. Although you'd be right in a strict theoretical sense, sure.