All the previous solutions seem to assume that the list of numbers is already sorted. In cases where this assumption cannot be made, an alternative solution is to simply insert the numbers into a diet.
eecs.oregonstate.edu/~erwig/papers/abstracts.html#JFP98
eecs.oregonstate.edu/~erwig/diet
--
Martin
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
