A Binary Tree Representation and Related Algorithms for Generating Partitions