This recent patch:
Added quick_sort_locations().
This replaces some O(n^2) algorithms with some that are O(n log(n))
Tries to optimise an O(n^2) operation to O(n log(n)), yet uses quicksort
in the process which can be O(n^2) all by itself.
Why not use (my personal favourite): heapsort?
Heapsort is O(n log(n)) as the *worst* case.
--
Sincerely,
Stephen R. van den Berg.
Our four weapons are: fear, surprise, a ruthless efficiency, an almost
fanatical devotion to the Pope... and nice red uniforms.
