Question
Pls do in java Here is BST code: public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean
Pls do in java
Here is BST code:
public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean search(int k){ BSTNode cur=null; while(cur!=null){ if(cur.key==k) return true; else if(k -------------------------- public class BSTNode{ int key; BSTNode left; BSTNode right; //Constructor public BSTNode(int k){ key=k; left=null; right=null; } } Here is BST code: public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean search(int k){ BSTNode cur=null; while(cur!=null){ if(cur.key==k) return true; else if(k -------------------------- public class BSTNode{ int key; BSTNode left; BSTNode right; //Constructor public BSTNode(int k){ key=k; left=null; right=null; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started