15 Red-Black Trees with Parent Pointers |
As our twelfth and final example of a table data structure, this chapter will implement a table as a red-black tree with parent pointers, or “PRB” tree for short. We use prb_ as the prefix for identifiers. Here's the outline:
551. <prb.h 551> = <License 1> #ifndef PRB_H #define PRB_H 1 #include <stddef.h> <Table types; tbl => prb 14> <RB maximum height; rb => prb 195> <TBST table structure; tbst => prb 250> <PRB node structure 553> <TBST traverser structure; tbst => prb 267> <Table function prototypes; tbl => prb 15> #endif /* prb.h */
552. <prb.c 552> = <License 1> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include "prb.h" <PRB functions 554>