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”.

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

#include <stddef.h>

<Table types; tbl => rtrb 15>
<RB maximum height; rb => rtrb 197>
<TBST table structure; tbst => rtrb 252>
<RTRB node structure 456>
<TBST traverser structure; tbst => rtrb 269>
<Table function prototypes; tbl => rtrb 16>

#endif /* rtrb.h */

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

<RTRB functions 457>