Graphviz 13.0.0~dev.20241220.2304
|
#include "config.h"
#include <assert.h>
#include <rbtree/red_black_tree.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
rb_red_blk_tree * | RBTreeCreate (int(*CompFunc)(const void *, const void *), void(*DestFunc)(void *)) |
static void | LeftRotate (rb_red_blk_tree *tree, rb_red_blk_node *x) |
static void | RightRotate (rb_red_blk_tree *tree, rb_red_blk_node *y) |
static void | TreeInsertHelp (rb_red_blk_tree *tree, rb_red_blk_node *z) |
rb_red_blk_node * | RBTreeInsert (rb_red_blk_tree *tree, void *key) |
rb_red_blk_node * | TreeSuccessor (rb_red_blk_tree *tree, rb_red_blk_node *x) |
rb_red_blk_node * | TreePredecessor (rb_red_blk_tree *tree, rb_red_blk_node *x) |
static void | TreeDestHelper (rb_red_blk_tree *tree, rb_red_blk_node *x) |
void | RBTreeDestroy (rb_red_blk_tree *tree) |
rb_red_blk_node * | RBExactQuery (rb_red_blk_tree *tree, void *q) |
static void | RBDeleteFixUp (rb_red_blk_tree *tree, rb_red_blk_node *x) |
void | RBDelete (rb_red_blk_tree *tree, rb_red_blk_node *z) |
|
static |
Definition at line 79 of file red_black_tree.c.
References rb_red_blk_node::left, rb_red_blk_node::parent, rb_red_blk_node::right, and tree.
Referenced by RBDeleteFixUp(), and RBTreeInsert().
void RBDelete | ( | rb_red_blk_tree * | tree, |
rb_red_blk_node * | z | ||
) |
Definition at line 524 of file red_black_tree.c.
References free(), rb_red_blk_node::key, rb_red_blk_node::left, rb_red_blk_node::parent, RBDeleteFixUp(), rb_red_blk_node::red, rb_red_blk_node::right, tree, TreeSuccessor(), and z.
Referenced by main().
|
static |
Definition at line 447 of file red_black_tree.c.
References rb_red_blk_node::left, LeftRotate(), rb_red_blk_node::parent, rb_red_blk_node::red, rb_red_blk_node::right, RightRotate(), and tree.
Referenced by RBDelete().
rb_red_blk_node * RBExactQuery | ( | rb_red_blk_tree * | tree, |
void * | q | ||
) |
Definition at line 412 of file red_black_tree.c.
References rb_red_blk_node::key, rb_red_blk_node::left, rb_red_blk_node::right, and tree.
Referenced by main().
rb_red_blk_tree * RBTreeCreate | ( | int(*)(const void *, const void *) | CompFunc, |
void(*)(void *) | DestFunc | ||
) |
Definition at line 27 of file red_black_tree.c.
References rb_red_blk_tree::Compare, rb_red_blk_tree::DestroyKey, free(), rb_red_blk_node::key, rb_red_blk_node::left, malloc(), rb_red_blk_tree::nil, NULL, rb_red_blk_node::parent, rb_red_blk_node::red, rb_red_blk_node::right, and rb_red_blk_tree::root.
Referenced by main().
void RBTreeDestroy | ( | rb_red_blk_tree * | tree | ) |
Definition at line 391 of file red_black_tree.c.
References free(), tree, and TreeDestHelper().
Referenced by main().
rb_red_blk_node * RBTreeInsert | ( | rb_red_blk_tree * | tree, |
void * | key | ||
) |
Definition at line 229 of file red_black_tree.c.
References rb_red_blk_node::key, rb_red_blk_node::left, LeftRotate(), malloc(), newNode(), NULL, rb_red_blk_node::parent, rb_red_blk_node::red, rb_red_blk_node::right, RightRotate(), tree, and TreeInsertHelp().
Referenced by main().
|
static |
Definition at line 132 of file red_black_tree.c.
References rb_red_blk_node::left, rb_red_blk_node::parent, rb_red_blk_node::right, and tree.
Referenced by RBDeleteFixUp(), and RBTreeInsert().
|
static |
Definition at line 367 of file red_black_tree.c.
References free(), rb_red_blk_node::key, rb_red_blk_node::left, rb_red_blk_node::right, tree, and TreeDestHelper().
Referenced by RBTreeDestroy(), and TreeDestHelper().
|
static |
Definition at line 181 of file red_black_tree.c.
References rb_red_blk_node::key, rb_red_blk_node::left, rb_red_blk_node::parent, rb_red_blk_node::right, tree, and z.
Referenced by RBTreeInsert().
rb_red_blk_node * TreePredecessor | ( | rb_red_blk_tree * | tree, |
rb_red_blk_node * | x | ||
) |
Definition at line 331 of file red_black_tree.c.
References rb_red_blk_node::left, rb_red_blk_node::parent, rb_red_blk_node::right, and tree.
Referenced by main().
rb_red_blk_node * TreeSuccessor | ( | rb_red_blk_tree * | tree, |
rb_red_blk_node * | x | ||
) |
Definition at line 296 of file red_black_tree.c.
References rb_red_blk_node::left, rb_red_blk_node::parent, rb_red_blk_node::right, and tree.
Referenced by main(), and RBDelete().