taskrambler
0.1.9
Web server and task management solution.
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | element |
Macros | |
#define | NVALUES 10 |
Enumerations | |
enum | rbColor { rbBlack =1, rbRed =2, rbBlack =1, rbRed =2 } |
Functions | |
struct element * | newElement (size_t size) |
struct element * | findElement (struct element *tree, size_t size) |
struct element * | grandparent (struct element *node) |
struct element * | uncle (struct element *node) |
struct element * | sibling (struct element *node) |
void | rotateLeft (struct element **tree, struct element *node) |
void | rotateRight (struct element **tree, struct element *node) |
void | replaceNode (struct element **tree, struct element *node1, struct element *node2) |
struct element * | insertElement (struct element **tree, struct element *element) |
struct element * | findInOrderSuccessor (struct element *tree) |
struct element * | deleteOneChild (struct element **, struct element *) |
struct element * | deleteElement (struct element **tree, struct element *element) |
void | traverse (struct element *tree, void(*cb)(struct element *, int)) |
void | post (struct element *tree, void(*cb)(struct element *, int)) |
void | printElement (struct element *node, int depth) |
void | cleanup (struct element *node, int depth) |
int | main (int argc, char *argv[]) |
struct element |
enum rbColor |
void cleanup | ( | struct element * | node, |
int | depth | ||
) |
Definition at line 697 of file rbtree.c.
References element::next, and printElement().
Definition at line 339 of file rbtree.c.
References element::color, findInOrderSuccessor(), element::last, element::left, element::next, element::parent, rbBlack, rbRed, replaceNode(), element::right, rotateLeft(), rotateRight(), sibling(), and element::size.
Referenced by main().
find element in tree
Definition at line 48 of file rbtree.c.
References element::left, element::right, and element::size.
Referenced by main().
delete element from tree
find minimum of the right subtree aka leftmost leaf of right subtree aka left in-order successor. We return the parent of the element in the out argument parent. This can be NULL wenn calling.
2: *successor = {size = 80, ptr = 0x603ae0, color = rbRed, parent = 0x603160, left = 0x0, right = 0x0} 1: *node = {size = 70, ptr = 0x603a60, color = rbBlack, parent = 0x603070, left = 0x6030e0, right = 0x6031e0}
Definition at line 325 of file rbtree.c.
References element::left, and element::right.
Referenced by deleteElement().
Definition at line 74 of file rbtree.c.
References element::parent.
Referenced by insertElement(), and uncle().
insert element in tree
Definition at line 194 of file rbtree.c.
References element::color, grandparent(), element::last, element::left, element::next, element::parent, rbBlack, rbRed, element::right, rotateLeft(), rotateRight(), element::size, and uncle().
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
=======================================================================
Definition at line 712 of file rbtree.c.
References deleteElement(), findElement(), insertElement(), newElement(), printElement(), and traverse().
struct element* newElement | ( | size_t | size | ) |
Definition at line 26 of file rbtree.c.
References element::color, element::last, element::left, element::next, element::parent, element::ptr, rbRed, element::right, element::size, and size.
Referenced by main().
Definition at line 618 of file rbtree.c.
References cb, element::left, element::parent, and element::right.
Referenced by CLASS(), httpRequestCtor(), and httpRequestDtor().
void printElement | ( | struct element * | node, |
int | depth | ||
) |
Definition at line 672 of file rbtree.c.
References element::color, element::next, element::ptr, rbRed, and element::size.
Referenced by cleanup(), and main().
Definition at line 169 of file rbtree.c.
References element::left, element::parent, and element::right.
Referenced by deleteElement().
Definition at line 117 of file rbtree.c.
References element::left, element::parent, and element::right.
Referenced by deleteElement(), and insertElement().
Definition at line 143 of file rbtree.c.
References element::left, element::parent, and element::right.
Referenced by deleteElement(), and insertElement().
Definition at line 100 of file rbtree.c.
References element::left, element::parent, and element::right.
Referenced by deleteElement().
Definition at line 568 of file rbtree.c.
References cb, element::left, element::parent, and element::right.
Referenced by main().
Definition at line 84 of file rbtree.c.
References grandparent(), element::left, element::parent, and element::right.
Referenced by insertElement().