Solution Review: Number of Full Nodes in a Binary Tree

Let’s take a detailed look at the previous challenge’s solution.

Solution

A full node is a node that has both left and right children. We’ll recursively traverse the whole tree and will increase the count of full nodes as we find them.

Code

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.