Given the root node root of a complete binary tree, return the total number of nodes in the tree.
A complete binary tree is a binary tree where every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible.
Note: The input tree is guaranteed to be complete.
Constraints:
The number of nodes in the tree is in the range
Node.val
The tree is complete.
Given the root node root of a complete binary tree, return the total number of nodes in the tree.
A complete binary tree is a binary tree where every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible.
Note: The input tree is guaranteed to be complete.
Constraints:
The number of nodes in the tree is in the range
Node.val
The tree is complete.