- Nikhil Jindal
Two classes to implement a Binary Search Tree (BST). Node.java contains the Nodes for the tree.
Node contains:
-
getKey:
- returns the key of the specified node
-
getter and setter methods for setting the right and left children
BinarySearchTree contains:
-
insert:
- inserts a specified node in the BST depending on the node's key
-
preorderRec:
- recursively traverses the BST in a preorder
-
sum:
- returns the sum of all keys of the BST
-
kthBiggest:
- returns the kth-largest Node in the BST
-
getRoot:
- returns the root of the BST
-
getNodeCount:
- returns the total count of nodes in BST