6 ms·
I don't know Perl, so I rewrote it in Python in an attempt to understand what's going on: https://gist.github.com/vlad003/35105af5892cb9cc5051 https://gist.gith
by vlad003 12y ago
I don't know Perl, so I rewrote it in Python in an attempt to understand what's going on: https://gist.github.com/vlad003/35105af5892cb9cc5051 https://gist.github.com/vlad003/35105af5892cb9cc5051
I'm not storing key,value pairs for elements that don't exist (not sure what the Perl code's doing), so it shouldn't be too bad in terms of space used.
- woadwarrior01 12y agoI'm not entirely sure about this, but it looks more like Counting sort [1], than Pigeonhole sort. [1]: https://en.wikipedia.org/wiki/Counting_sort https://en.wikipedia.org/wiki/Counting_sort