Given multiple path nodes find common nodes
Answers
Answered by
0
Given a binary tree and two nodes, the task is to Print all the nodes that are common for 2 given nodes in a binary tree.
Examples:
Given binary tree is : 1 / \ 2 3 / \ / \ 4 5 6 7 / / \ 8 9 10 Given nodes 9 and 7, so the common nodes are:- 1, 3
I THINK IT WILL HELP YOU
Examples:
Given binary tree is : 1 / \ 2 3 / \ / \ 4 5 6 7 / / \ 8 9 10 Given nodes 9 and 7, so the common nodes are:- 1, 3
I THINK IT WILL HELP YOU
Similar questions