Print All The Full Nodes in a Binary Tree

Objective: Given a binary tree, print all nodes will are full nodes.

Full Nodes: Nodes Which has both the children, left and right are called Full Nodes

Approach:

quite simple Solution.

  • Do the any of the traversal (inorder, preorder, postorder etc).
  • During traversal, check the node if it has left child and right child, If yes then print it

Complete Code:


Output:

Full Nodes are 2 1

__________________________________________________
Top Companies Interview Questions..-

Google Microsoft Amazon Facebook more..

If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.
__________________________________________________

%d bloggers like this: