Binary Search Tree
BST has 3 basic operations
- find (x)
- insert (x)
- remove (x)
Property of BST makes searching easy.
If we’re trying to find(x), we begin with these steps:
- We start at root
- If root contains x, search is successful
- If x<root, search is done on left, if x>root, search is done on the right side.
- Search is repeated and done recursively
Example of a tree: