binary search tree impelementation and java
I am trying to implement BST algorithm using Cormen's pseudo code yet having issue. Here is my Code for Node: public class Node { Node left; Node right; int value; Node(int value){ this.value = value; this.left = null; this.right = null; } } and for the Bstree: public class Btree { Node root; Btree(){ this.root = null; } public static void inorderWalk(Node n){ if(n != null){ inorderWalk(n.left); System.out.print(n.value + " "); inorderWalk(n.right); } } public static Node getParent(Btree t, Node n){ Node current = t.root; Node parent = null; while(true){ if (current == null) return null; if(