root
is null
, return true
as an empty tree is a complete binary tree.root
to it.nullNodeFound
to false
.null
, set nullNodeFound
to true
.
c. If the node is not null
:
i. If nullNodeFound
is true
, return false
as we have found a non-null node after a null
node.
ii. Otherwise, enqueue the left and right children of the node.false
, return true
.