← 返回 snowflake 的题目列表Determine if a Binary Tree is Perfect
类型:online_judge
Given a binary tree, determine if it is a perfect binary tree. A perfect binary tree is defined as a tree where every internal node has exactly two children and all leaf nodes are at the same level. Implement a function to check if a given binary tree meets these conditions.
Example
Input
1
2 3
4 5 6 7