On Mon, 21 May 2007, Steffen Mazanek wrote: > is there an efficient algorithm that takes two positive numbers n and m and > that computes all lists l of numbers 0<x<=n such that sum l = m? > > For instance > alg 5 1 = [[1]] > alg 5 2 = [[1,1],[2]] > alg 5 3 = [[1,1,1],[1,2],[2,1],[3]] > ...
http://darcs.haskell.org/htam/src/Combinatorics/Partitions.hs alg = flip partitionsDec _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
