package Node;public class BSTnode { private BSTnode left; // pointer for the left child node private BSTnode right; // pointer for the right child node public int nodeData; public BSTnode (int newData) { left = null; right = null; nodeData = newData; } public void insertNode (int nodeInteger) { if (nodeInteger < nodeData) { /* if the node to be inserted is smaller than the previous node, it is inserted in the left sub-tree */ if (left == null) left = new BSTnode (nodeInteger); else left.insertNode (nodeInteger); } else if (nodeInteger > nodeData) { /* if the node to be inserted is larger than the previous node, it is inserted in the right sub-tree */ if (right == null) right = new BSTnode (nodeInteger); else right.insertNode (nodeInteger); } } public BSTnode getLeft() { return left; } public BSTnode getRight() { return right; } public int getData() { return nodeData; } public void show() { System.out.println(getData()); }}