4 ms·
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.?
by OJFord 5y 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.?
- albertsondev 5y agoOr 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.