Hacker News new | ask | show | jobs
by albertsondev 1724 days ago
Or even neither!

Much faster to find upper and lower bounds and essentially construct a hash table than to manually sort a whole list of non-trivial length.

2 comments

Is it really? Building the hash can be made in linear time but iterating the values in order, especially when there might be gaps in the interval? Could be messy
The overhead of hashing in a hash table makes it worse than sorting algorithms without hashing.