18 ms·
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.
by albertsondev 5y 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.
- cjohansson 5y agoIs 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
- daniel-cussen 5y agoThe overhead of hashing in a hash table makes it worse than sorting algorithms without hashing.