Https://hack.codingblocks.com/contests/c/537/141

how to build a generic tree in this question

Hi Aastha, a generic tree is a tree in which each node can have arbitrary number of children. So, in order to build a generic tree, instead of keeping left and right child pointers in the node class, you can keep a vector which will store the address of all the children of a given node. Try to implement it and reply to this thread if you face any difficulty.