sorting.pl : Numbers to sorted chain
Constructs a sorted chain from single values using ordered merge.
Time-complexity is O(n^2) (n numbers to sort).
How to use:
For positive numbers X1, .., Xn, you enter
sort(X1), .., sort(Xn),
and get them sorted with duplicates removed (S1 < S2 < .. < Sm) as
0 <<< S1, S1 <<< S2, .., S(m-1) <<< Sm.