4.4 Operations |
Now can start to implement the operations that we'll want to perform on BSTs. Here's the outline of the functions we'll implement. We use the generic table insertion convenience functions from Exercise 2.8-3 to implement bst_insert() and bst_replace(), as well the generic assertion function implementations from Exercise 2.9-2 to implement tbl_assert_insert() and tbl_assert_delete(). We also include a copy of the default memory allocation functions for use with BSTs:
29. <BST operations 29> = <BST creation function 30> <BST search function 31> <BST item insertion function 32> <Table insertion convenience functions; tbl => bst 592> <BST item deletion function 37> <BST traversal functions 63> <BST copy function 83> <BST destruction function 84> <BST balance function 87> <Default memory allocation functions; tbl => bst 6> <Table assertion functions; tbl => bst 594>
This code is included in 25.