ROSS
avl_tree.c File Reference
#include "avl_tree.h"
#include <math.h>
#include <assert.h>
#include "ross-kernel-inline.h"

Go to the source code of this file.

Functions

void avlDestroy (AvlTree t)
int avlGetHeight (AvlTree t)
int avlSearch (AvlTree t, tw_event *key)
void avlSanityCheck (AvlTree root)
static void avlFixHeight (AvlTree t)
static void avlRotate (AvlTree *root, int d)
static void avlRebalance (AvlTree *t)
void avlInsert (AvlTree *t, tw_event *key)
void avlPrintKeys (AvlTree t)
tw_eventavlDeleteMin (AvlTree *t)
tw_eventavlDelete (AvlTree *t, tw_event *key)
AvlTree avl_alloc (void)
void avl_free (AvlTree t)

Variables

tw_pepe

Function Documentation

◆ avl_alloc()

AvlTree avl_alloc ( void )

Definition at line 330 of file avl_tree.c.

References g_tw_avl_node_count, g_tw_pe, avlNode::next, tw_error(), and TW_LOC.

Referenced by avlInsert().

◆ avl_free()

void avl_free ( AvlTree t)

Definition at line 346 of file avl_tree.c.

References AVL_EMPTY, and g_tw_pe.

Referenced by avlDelete(), avlDeleteMin(), and avlDestroy().

◆ avlDelete()

◆ avlDeleteMin()

tw_event * avlDeleteMin ( AvlTree * t)

Definition at line 245 of file avl_tree.c.

References AVL_EMPTY, avl_free(), avlDeleteMin(), avlRebalance(), avlNode::child, and avlNode::key.

Referenced by avlDelete(), and avlDeleteMin().

◆ avlDestroy()

void avlDestroy ( AvlTree t)

Definition at line 14 of file avl_tree.c.

References AVL_EMPTY, avl_free(), avlDestroy(), and avlNode::child.

Referenced by avlDestroy().

◆ avlFixHeight()

void avlFixHeight ( AvlTree t)
static

Definition at line 96 of file avl_tree.c.

References AVL_EMPTY, avlGetHeight(), avlNode::child, avlNode::height, and ROSS_MAX.

Referenced by avlRebalance(), and avlRotate().

◆ avlGetHeight()

int avlGetHeight ( AvlTree t)

Definition at line 27 of file avl_tree.c.

References AVL_EMPTY, and avlNode::height.

Referenced by avlFixHeight(), avlRebalance(), and avlSanityCheck().

◆ avlInsert()

◆ avlPrintKeys()

void avlPrintKeys ( AvlTree t)

Definition at line 233 of file avl_tree.c.

References AVL_EMPTY, avlPrintKeys(), and avlNode::child.

Referenced by avlPrintKeys().

◆ avlRebalance()

void avlRebalance ( AvlTree * t)
static

Definition at line 138 of file avl_tree.c.

References AVL_EMPTY, avlFixHeight(), avlGetHeight(), and avlRotate().

Referenced by avlDelete(), avlDeleteMin(), and avlInsert().

◆ avlRotate()

void avlRotate ( AvlTree * root,
int d )
static

Definition at line 115 of file avl_tree.c.

References avlFixHeight(), and avlNode::child.

Referenced by avlRebalance().

◆ avlSanityCheck()

void avlSanityCheck ( AvlTree root)

Definition at line 81 of file avl_tree.c.

References AVL_EMPTY, avlGetHeight(), avlSanityCheck(), avlNode::child, avlNode::height, and ROSS_MAX.

Referenced by avlSanityCheck().

◆ avlSearch()

Variable Documentation

◆ pe