GENERATE SUBTREES OF A TREE

Hi, can someone share the code to generate all sub-trees of a tree.

all subree or subtree size ?

all

I think you can make a dfs or bfs call from every node.It should give all possible subtrees.