11 Right-Threaded AVL Trees [ToC] [Index]     [Skip Back] [Skip Fwd]     [Prev] [Up] [Next]

In the same way that we can combine threaded trees with AVL trees to produce threaded AVL trees, we can combine right-threaded trees with AVL trees to produce right-threaded AVL trees. This chapter explores this combination, producing another table implementation.

Here's the form of the source and header files. Notice the use of rtavl_ as the identifier prefix. Likewise, we will often refer to right-threaded AVL trees as “RTAVL trees”.

417. <rtavl.h 417> =
<Library License 1>
#ifndef RTAVL_H
#define RTAVL_H 1

#include <stddef.h>

<Table types; tbl => rtavl 15>
<BST maximum height; bst => rtavl 29>
<TBST table structure; tbst => rtavl 252>
<RTAVL node structure 419>
<TBST traverser structure; tbst => rtavl 269>
<Table function prototypes; tbl => rtavl 16>

#endif /* rtavl.h */

418. <rtavl.c 418> =
<Library License 1>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "rtavl.h"

<RTAVL functions 420>