Danielnguyen0130
BAN USER- 0of 0 votes
AnswersGiven a binary tree,Write a function to return all of the nodes from a given node and a given distance. The function has three parameters root, the given node and the given distance. For example
- Danielnguyen0130 in United States
5
/\
4 7
/\
6 10
\
12
Calling the function F(root,7,1) will the return all the nodes from node 7 with the distance 1 which is 6,10,5
another example is F(root.7,2) will the return nodes 12,4| Report Duplicate | Flag | PURGE
Trees and Graphs - 0of 0 votes
AnswersWrite a function to return all of the nodes from a given node and a given distance. The function has three parameter root, the given node and the given distance. For example
- Danielnguyen0130 in United States
5
/\
4 7
/\
6 10
\
12
Calling the function F(root,7,1) will the return all the nodes from node 7 with the distance 1 which is 6,10,5
another example is F(root.7,2) will the return nodes 12,4| Report Duplicate | Flag | PURGE
Trees and Graphs - -1of 1 vote
AnswersGive a Binary tree, write a function to return all the nodes from a given with a given distance. The function has three parameters root of tree, a given node, a given distance. For example,
- Danielnguyen0130 in United States
5
/\
4 7
/\
3 10
\
12
calling the function F(root,7,1) will return nodes 3,5,10
calling F(root,7,2) will return nodes 12,4| Report Duplicate | Flag | PURGE
Trees and Graphs