Implement binary search trees using JAVA
A binary search tree is a rooted binary tree, whose internal nodes each store a key (and optionally, an associated value) and each have two distinguished sub-trees, commonly denoted left and right. The tree additionally satisfies the binary search property, which states that the key in each node must be greater than or equal to any key stored in the left sub-tree, and less than or equal to any key stored in the right sub-tree. The leaves (final nodes) of the tree contain no key and have no structure to distinguish them from one another.
Code rules: Positive inputs are add to the tree. Negative inputs are remove from the tree the element which has the absolute value of input.
Methods implemented:
- find
- contains
- get
- add
- remove
- min
- max
- toArray