TRB Operations - GNU libavl 2.0.3
Author: Ben Pfaff

9.2 Operations |

Now we'll implement all the usual operations for TRB trees. Here's the outline. We can reuse everything from TBSTs except insertion, deletion, and copy functions. The copy function is implemented by reusing the version for TAVL trees, but copying colors instead of balance factors.

    338. <TRB functions 338> =
    <TBST creation function; tbst => trb 254>
    <TBST search function; tbst => trb 255>
    <TRB item insertion function 339>
    <Table insertion convenience functions; tbl => trb 594>
    <TRB item deletion function 351>
    <TBST traversal functions; tbst => trb 270>
    <TAVL copy function; tavl => trb; tavl_balance => trb_color 331>
    <TBST destruction function; tbst => trb 283>
    <Default memory allocation functions; tbl => trb 7>
    <Table assertion functions; tbl => trb 596>

This code is included in 336.