The third simulation game of the 12th Blue Bridge Cup-the number of leaf nodes

1. Problem description:

There is a binary tree, one has 2021 nodes, of which 1000 nodes have two child nodes, and the other nodes have one or 0 child nodes. Excuse me, how many leaf nodes does this binary tree have

2. Thinking analysis:

Examine the relationship between the node with degree 2 and the node with degree 0 in the binary tree, n0 = n2 + 1, that is, the number of nodes with degree 0 is: 1000 + 1 = 1001

Guess you like

Origin blog.csdn.net/qq_39445165/article/details/115141958