- 0of 0 votes
Given a binary tree, write a recursive method boolean method(int x, int y) which will return true- bojanlozanovski77 August 16, 2017 in United States
1. if node y (meaning a node with a value of int y) is a node that is contained in one of the two possible subtrees of x,
2. true if x==y, and a node with a value x==y exists, otherwise
3. return false,
basicallly whether x contains y? I had a question like this on my exam, I solved this problem using four arguments in my function. I wonder whether it is even possible to solve it with only 2 int arguments and recursively.
| Report Duplicate | Flag | PURGE
Trees and Graphs