2 ms·
> developer didn’t realize Array.sort() was unstable You seem to think stable sort is much more important than most of the rest of the field. By default, C so
by paulddraper 7y ago
> developer didn’t realize Array.sort() was unstable
You seem to think stable sort is much more important than most of the rest of the field.
By default, C sort isn't stable, C++ sort isn't stable, Ruby sort isn't stable, C# sort isn't stable, Perl sort isn't stable. Hell, not even GNU's sort utility is stable.
JavaScript has some unexpected idiosyncracies, but sort() stability isn't one of them.