3 ms·
I made this[0] a while back as an implementation of merge sort in JavaScript with continuation passing style. His seems very similar but uses quicksort. Surpris
by dsamarin 8y ago
I made this[0] a while back as an implementation of merge sort in JavaScript with continuation passing style. His seems very similar but uses quicksort. Surprising since merge sort has fewer comparisons than quicksort's average case[1]. Why exactly does he use a matrix to store the comparisons?
[0]: https://jsfiddle.net/dsamarin/hgdjwtck/ https://jsfiddle.net/dsamarin/hgdjwtck/
[1]: https://stackoverflow.com/questions/8535540/exactly-how-many-comparisons-does-merge-sort-make https://stackoverflow.com/questions/8535540/exactly-how-many...