题目描述
Given a Binary Tree, write a function to check whether the given Binary Tree is Complete Binary Tree or not. A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes should be as much close to left as possible.
Example 1:
Input:
1
/ \
2 3
Output:
Complete Binary Tree
Example 2:
Input:
1
/ \
2 3
\ / \
4 5 6
Output:
Not Complete Binary Tree
Constraints:
1<=Number of Node<=100
0 <= Data of a node <= 10^{6}
Your Task:
You don't need to take input. Just complete the function isCompleteBT() that takes root node as a parameter and returns true, if the tree is Complete else returns false.
输入格式
见题面
输出格式
见题面