GNU libavl 2.0.1
Author: Ben Pfaff

14 AVL Trees with Parent Pointers |

This chapter adds parent pointers to AVL trees. The result is a data structure that combines the strengths of AVL trees and trees with parent pointers. Of course, there's no free lunch: it combines their disadvantages, too.

The abbreviation we'll use for the term "AVL tree with parent pointers" is "PAVL tree", with corresponding prefix pavl_. Here's the outline for the PAVL table implementation:

    519. <pavl.h 519> =
    <License 1>
    #ifndef PAVL_H
    #define PAVL_H 1

    #include <stddef.h>

    <Table types; tbl => pavl 14>
    <BST maximum height; bst => pavl 28>
    <TBST table structure; tbst => pavl 250>
    <PAVL node structure 521>
    <TBST traverser structure; tbst => pavl 267>
    <Table function prototypes; tbl => pavl 15>

    #endif /* pavl.h */

    520. <pavl.c 520> =
    <License 1>
    #include <assert.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include "pavl.h"

    <PAVL functions 522>

Sections:

- 14.1 Data Types
- 14.2 Rotations
- 14.3 Operations
- 14.4 Insertion
  - 14.4.1 Steps 1 and 2: Search and Insert
  - 14.4.2 Step 3: Update Balance Factors
  - 14.4.3 Step 4: Rebalance
  - 14.4.4 Symmetric Case
- 14.5 Deletion
  - 14.5.1 Step 2: Delete
  - 14.5.2 Step 3: Update Balance Factors
  - 14.5.3 Step 4: Rebalance
  - 14.5.4 Symmetric Case
- 14.6 Traversal
- 14.7 Copying
- 14.8 Testing

13.8 Testing | Table of Contents | 14.1 Data Types