Binary tree number of nodes with a given level
问题 I need to write a program that counts the number of nodes from a certain level given in binary tree. I mean < numberofnodes(int level){} > I tried writing it without any success because I don't how to get to a certain level then go to count number of nodes. 回答1: Do it with a recursive function which only descends to a certain level. 回答2: Well, there are many ways you can do this. Best is to have a single dimensional array that keep track of the number of nodes that you add/remove at each