└── insert BST.txt /insert BST.txt: -------------------------------------------------------------------------------- 1 | /* Node is defined as : 2 | class Node 3 | int data; 4 | Node left; 5 | Node right; 6 | 7 | */ 8 | 9 | public static Node insert(Node root,int data) { 10 | 11 | if(root==null) 12 | { 13 | root=new Node(data); 14 | return root; 15 | } 16 | if(dataroot.data) 19 | root.right=insert(root.right, data); 20 | return root; 21 | } --------------------------------------------------------------------------------