[erlang-questions] algorithm of lists:sort?
Wed Nov 21 20:48:03 CET 2012
I am looking at implementation of lists:sort. I need to describe it to
my colleague, so he can implement an analogous version in C++ (he does
not know Erlang). Looking at the code it is very non-obvious how it
works. There is a lot of pattern matching, but it is very hard to get
the picture. Trapexit says it's a merge sort. But why is the
implementation so big?
Functions involved in lists:sort:
... and so on ...
If anyone knows its internals, I would very much appreciate a high
level description of the algorithm. Maybe with brief description what
the merge_x_x and split_x_x functions are doing?
More information about the erlang-questions