AVL Operations - GNU libavl 2.0.3
Author: Ben Pfaff

5.3 Operations |

Now we'll implement for AVL trees all the operations that we did for BSTs. Here's the outline. Creation and search of AVL trees is exactly like that for plain BSTs, and the generic table functions for insertion convenience, assertion, and memory allocation are still relevant, so we just reuse the code. Of the remaining functions, we will write new implementations of the insertion and deletion functions and revise the traversal and copy functions.

    147. <AVL functions 147> =
    <BST creation function; bst => avl 31>
    <BST search function; bst => avl 32>
    <AVL item insertion function 148>
    <Table insertion convenience functions; tbl => avl 594>
    <AVL item deletion function 166>
    <AVL traversal functions 180>
    <AVL copy function 187>
    <BST destruction function; bst => avl 85>
    <Default memory allocation functions; tbl => avl 7>
    <Table assertion functions; tbl => avl 596>

This code is included in 144.