It's an easy problem. I will give you a binary tree. You just need to tell me the width of the binary tree. The width of a binary tree means the maximum number of nodes in a same level.
For example, the width of binary tree above is 3.
输入
The first line is an integer T, means the number of cases. Then follow T cases. For each case, the first line is an integer N, means the number of nodes. (1 <= N <= 10) Then follow N lines. Each line contains 3 integers P A B; indicate the number of this node and its two children node. If the node doesn’t have left child or right child, then replace it by -1. You can assume the root is 1.