Are there any efficient ways to populate a balanced tree structure
问题 I have a balanced binary tree structure: Node 0 at depth 0 is the root. The root's left child is 1 and right child is 2 , and so on. Please see image: The total depth of the tree is given as N . This N is the only parameter of the problem. Nodes at level N are designated as leaf nodes. I am storing this tree using the following node structure. struct node_s{ int n, depth, parent;//n is node number int nodescendents;//number of descendents of the current node std::vector<int> descendents;/