The title sounds too complex, but my question is actually simple. Suppose I have [1,2,3,4,5], then there are many ways of making clustering. Among them, I want to pair up terminals until there is only one left at the end. For example, ((((1,2),3),4),5), (1,(2,(3,(4,5)))), or (((1,2),(3,4)), 5) would be legitimate ones.
How do you think can I, using the modules of Python such as itertools as much as possible, make all possible such clusterings? Thanks in advance, Justin. -- http://mail.python.org/mailman/listinfo/python-list