Complete Binary Tree
Given a binary tree root
, return whether it’s a complete binary tree.
Constraints
n ≤ 100,000
wheren
is the number of nodes inroot
https://binarysearch.com/problems/Complete-Binary-Tree
Examples
Example 1
Input
- root =
Output
- answer =
True
Example 2
Input
- root =
Output
- answer =
True
Example 3
Input
- root =
Output
- answer =
False
Leave a comment