You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a given Binary Tree of type integer, print all the nodes without any siblings.
The first and the only line of input will contain the node data, all separated by a single space. Since -1 is used as an indication of whether the left or right node data exist for root, it will not be a part of the node data.
For a given Binary Tree of type integer, print all the nodes without any siblings.
The first and the only line of input will contain the node data, all separated by a single space. Since -1 is used as an indication of whether the left or right node data exist for root, it will not be a part of the node data.
Input Sample
2 4 5 6 -1 -1 7 20 30 80 90 -1 8 9 -1 -1 -1 -1 -1 -1 -1 -1 -1
Output Sample
6 8 7 9
The text was updated successfully, but these errors were encountered: