Problem C: 求叶节点数
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:108
Solved:69
Description
给定一前序二叉树的数据,请构造根节点为 root 的二叉树,输出这棵树叶节点个数。
Input
输入为一棵树的先序遍历序列,遇到不存在的子节点用0表示。
Output
输出二叉树的叶节点个数。
Sample Input Copy
4 2 1 0 0 3 0 0 6 5 0 0 0 -1
Sample Output Copy
3
HINT
二叉树的深度最深为18层。