This post is completed by 1 user
|Add to List|
Given a binary tree, Print All the Nodes that don't have Siblings.
Objective: Given a binary tree, Print All the Nodes that don't have siblings.
Note: sibling node is the node which has the same parent, so you need to print the nodes who is a single child of his parent.
Input: A binary tree.
- Do the inorder traversal.
- check if the node has only a child, if yes then print that child.
Nodes with No Siblings: 6 7 8 9
- Populate Next Siblings Pointers in a Given Binary Tree OR Populate Next Right Pointers in Each Node Hard