Math, asked by Sanjay9377, 1 year ago

Given multiple path nodes find common nodes

Answers

Answered by AyushSingh1111
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
Similar questions