Question: hello i have a question i need help with so i want to search and return a value from binary search tree but i have

hello i have a question i need help with so i want to search and return a value from binary search tree but i have a problem every time i try to print the result it keeps giving me a null value so i will drop down my code please read it and tell what is my mistake or write me the code that i should add note** i have a treeNode class and tree class so i want the to solve the problem with this way not the one's that have a key and lablablah....the class treeNode has {data,leftChild,rightChild} and the tree calss has {root}

hello i have a question i need help with so i wantto search and return a value from binary search tree but ihave a problem every time i try to print the result it

public TreeNode get(int value) { //if we find it in the root if(value==data){return this;} //if the value is smaller then we will search in the left side as we know the left side is always smaller if(value Main (3) [Java Application] C:\Program Files\Java\jdk-17\bin\javaw.exe (27 Dec 2021, 20:12:43 20:12:43) value is null value is null value is null

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!