12 Right-Threaded Red-Black Trees [ToC] [Index]     [Skip Back] [Skip Fwd]     [Prev] [Up] [Next]

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>