Hacker News new | ask | show | jobs
by OJFord 1716 days ago
That's just the right solution if you know x and y (or even just x?) ahead of time isn't it?

And don't you mean "27" into register 27-x, do. 18 etc.?

1 comments

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.

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.