Binary Search Trees (cont)
Operations on BSTs:
- insert(Tree,Item) … add new item to tree via key
- delete(Tree,Key) … remove item with specified key from tree
- search(Tree,Key) … find item containing key in tree
- plus, "bookkeeping" … new(), free(), show(), …
Notes:
- in general, nodes contain
Item s; we just show Item.key
- keys are unique (not technically necessary)
|