I have an n-ary tree and I want to get all possible representations of the tree that cover (for lack of a better term) the tree. Here's what I mean by cover:Suppose we have the following tree        1     /    \    2      3   / \    /|\  4   6  5 7 8      |      9I want to somehow obtain the following:12, 32, 5, 7, 84, 6, 34, 6, 5, 7, 8 4, 9, 34, 9, 5, 7, 8As you can see 1 completely covers the tree because all leaves are underneath it. Similarly 2, 3 covers the entire tree because all leaves are underneath them. This goes for all of them until finally we get to 4, 9, 5, 7, 8 which covers the entire tree because all leaves are underneath (or are them).Is there an algorithm to do this or a modification of a classic search algorithm that will produce this? 
How can I get all representations of an n-ary tree that completely cover the tree?
graphs;trees;graph traversal