Given the root of a binary tree, determine if it is a complete binary tree.
In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. The last level can have between 1 and 2ʰ nodes inclusive, where h is the height of the tree.
Example 1:
Input: root = [1, 2, 3, 4, 5, 6]
Output: true
Explanation: Every level before the last is full, and all nodes in the last level are as far left as possible.
Example 2:
Input: root = [1, 2, 3, 4, 5, null, 7]
Output: false
Explanation: Node 7 is on the right side of level 2, but the position to its left (node 3's left child) is empty. This violates the completeness property.
Example 3:
Input: root = [1]
Output: true
[1, 100]1 <= Node.val <= 1000