GNU libavl 2.0.1
Author: Ben Pfaff

12 Right-Threaded Red-Black Trees |

This chapter is this book's final demonstration of right-threaded trees, carried out by using them in a red-black tree implementation of tables. The chapter, and the code, follow the pattern that should now be familiar, using rtrb_ as the naming prefix and often referring to right-threaded right-black trees as "RTRB trees".

    452. <rtrb.h 452> =
    <License 1>
    #ifndef RTRB_H
    #define RTRB_H 1

    #include <stddef.h>

    <Table types; tbl => rtrb 14>
    <RB maximum height; rb => rtrb 195>
    <TBST table structure; tbst => rtrb 250>
    <RTRB node structure 454>
    <TBST traverser structure; tbst => rtrb 267>
    <Table function prototypes; tbl => rtrb 15>

    #endif /* rtrb.h */

    453. <rtrb.c 453> =
    <License 1>
    #include <assert.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include "rtrb.h"

    <RTRB functions 455>

Sections:

- 12.1 Data Types
- 12.2 Operations
- 12.3 Insertion
  - 12.3.1 Steps 1 and 2: Search and Insert
  - 12.3.2 Step 3: Rebalance
- 12.4 Deletion
  - 12.4.1 Step 2: Delete
  - 12.4.2 Step 3: Rebalance
  - 12.4.3 Step 4: Finish Up
- 12.5 Testing

11.7 Testing | Table of Contents | 12.1 Data Types