[prev] 16 [next]

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 Items; we just show Item.key
  • keys are unique   (not technically necessary)