Re:Making an Endpoint 50x Faster
by ignoramous on Saturday December 07, 2019 @11:01AM
(#21730919)
Consider character sequences: [n, e, t] and [t, e, n]. If you'd want to know if the lists are equivalent (have the same characters, same number of times), then sorting them would make the comparison straight-forward since order doesn't matter.
Re:Making an Endpoint 50x Faster
by mobilemidget on Saturday December 07, 2019 @03:03PM
(#21732258)
ah yes but of course, probably did not have enough coffee yet when I read it :) thank you
But then perhaps it is worth storing it sorted ( or as well if original value is important) and making it even faster?
They order does not matter and can be arbitrary. But when you compare two entries you need to sort them, because the entries are arrays. It's like the trick of converting sttings to lower-case to get an case-insensitive comparison (which is a bad idea in a non-Latin world, but that's another story).
I do not understand this line very well. If order does not matter, why sort anything?