Macros | Functions
Tree.c File Reference

functions which apply to tree structures. More...

#include "Tree.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "Heap.h"
Include dependency graph for Tree.c:

Go to the source code of this file.

Macros

#define LEFT   0
 
#define max(a, b)   (a > b) ? a : b;
 
#define RIGHT   1
 
#define TREE_C   /* so that malloc/free/realloc aren't redefined by Heap.h */
 

Functions

int isBlack (Node *aNode)
 
int isRed (Node *aNode)
 
void * TreeAdd (Tree *aTree, void *content, size_t size)
 
void * TreeAddByIndex (Tree *aTree, void *content, size_t size, int index)
 
void TreeAddIndex (Tree *aTree, int(*compare)(void *, void *, int))
 
NodeTreeBAASub (Tree *aTree, Node *curnode, int which, int index)
 
void TreeBalanceAfterAdd (Tree *aTree, Node *curnode, int index)
 
void TreeBalanceAfterRemove (Tree *aTree, Node *curnode, int index)
 
NodeTreeBARSub (Tree *aTree, Node *curnode, int which, int index)
 
NodeTreeFind (Tree *aTree, void *key)
 
NodeTreeFindContentIndex (Tree *aTree, void *key, int index)
 
NodeTreeFindIndex (Tree *aTree, void *key, int index)
 
NodeTreeFindIndex1 (Tree *aTree, void *key, int index, int value)
 
void TreeFree (Tree *aTree)
 
TreeTreeInitialize (int(*compare)(void *, void *, int))
 
void TreeInitializeNoMalloc (Tree *aTree, int(*compare)(void *, void *, int))
 
int TreeIntCompare (void *a, void *b, int content)
 
NodeTreeMinimum (Node *curnode)
 
NodeTreeNextElement (Tree *aTree, Node *curnode)
 
NodeTreeNextElementIndex (Tree *aTree, Node *curnode, int index)
 
int TreePtrCompare (void *a, void *b, int content)
 
void * TreeRemove (Tree *aTree, void *content)
 
void * TreeRemoveIndex (Tree *aTree, void *content, int index)
 
void * TreeRemoveKey (Tree *aTree, void *key)
 
void * TreeRemoveKeyIndex (Tree *aTree, void *key, int index)
 
void * TreeRemoveNodeIndex (Tree *aTree, Node *curnode, int index)
 
void TreeRotate (Tree *aTree, Node *curnode, int direction, int index)
 
int TreeStringCompare (void *a, void *b, int content)
 
NodeTreeSuccessor (Node *curnode)
 

Detailed Description

functions which apply to tree structures.

These trees can hold data of any sort, pointed to by the content pointer of the Node structure.

Definition in file Tree.c.

Macro Definition Documentation

#define LEFT   0

Definition at line 95 of file Tree.c.

#define max (   a,
 
)    (a > b) ? a : b;

Definition at line 98 of file Tree.c.

#define RIGHT   1

Definition at line 96 of file Tree.c.

#define TREE_C   /* so that malloc/free/realloc aren't redefined by Heap.h */

Definition at line 24 of file Tree.c.

Function Documentation

int isBlack ( Node aNode)

Definition at line 109 of file Tree.c.

int isRed ( Node aNode)

Definition at line 103 of file Tree.c.

void* TreeAdd ( Tree aTree,
void *  content,
size_t  size 
)

Definition at line 274 of file Tree.c.

void * TreeAddByIndex ( Tree aTree,
void *  content,
size_t  size,
int  index 
)

Add an item to a tree

Parameters
aTreethe list to which the item is to be added
contentthe list item content itself
sizethe size of the element

Definition at line 210 of file Tree.c.

void TreeAddIndex ( Tree aTree,
int(*)(void *, void *, int)  compare 
)

Definition at line 78 of file Tree.c.

Node * TreeBAASub ( Tree aTree,
Node curnode,
int  which,
int  index 
)

Definition at line 166 of file Tree.c.

void TreeBalanceAfterAdd ( Tree aTree,
Node curnode,
int  index 
)

Definition at line 191 of file Tree.c.

void TreeBalanceAfterRemove ( Tree aTree,
Node curnode,
int  index 
)

Definition at line 401 of file Tree.c.

Node * TreeBARSub ( Tree aTree,
Node curnode,
int  which,
int  index 
)

Definition at line 364 of file Tree.c.

Node* TreeFind ( Tree aTree,
void *  key 
)

Definition at line 315 of file Tree.c.

Node * TreeFindContentIndex ( Tree aTree,
void *  key,
int  index 
)

Definition at line 309 of file Tree.c.

Node* TreeFindIndex ( Tree aTree,
void *  key,
int  index 
)

Definition at line 303 of file Tree.c.

Node * TreeFindIndex1 ( Tree aTree,
void *  key,
int  index,
int  value 
)

Definition at line 286 of file Tree.c.

void TreeFree ( Tree aTree)

Definition at line 85 of file Tree.c.

Tree* TreeInitialize ( int(*)(void *, void *, int)  compare)

Allocates and initializes a new tree structure.

Returns
a pointer to the new tree structure

Definition at line 65 of file Tree.c.

void TreeInitializeNoMalloc ( Tree aTree,
int(*)(void *, void *, int)  compare 
)

Definition at line 53 of file Tree.c.

int TreeIntCompare ( void *  a,
void *  b,
int  content 
)

Definition at line 535 of file Tree.c.

Node * TreeMinimum ( Node curnode)

Definition at line 321 of file Tree.c.

Node* TreeNextElement ( Tree aTree,
Node curnode 
)

Definition at line 358 of file Tree.c.

Node * TreeNextElementIndex ( Tree aTree,
Node curnode,
int  index 
)

Definition at line 348 of file Tree.c.

int TreePtrCompare ( void *  a,
void *  b,
int  content 
)

Definition at line 545 of file Tree.c.

void* TreeRemove ( Tree aTree,
void *  content 
)

Definition at line 498 of file Tree.c.

void * TreeRemoveIndex ( Tree aTree,
void *  content,
int  index 
)

Remove an item from a tree

Parameters
aTreethe list to which the item is to be added
curnodethe list item content itself

Definition at line 487 of file Tree.c.

void* TreeRemoveKey ( Tree aTree,
void *  key 
)

Definition at line 529 of file Tree.c.

void* TreeRemoveKeyIndex ( Tree aTree,
void *  key,
int  index 
)

Definition at line 510 of file Tree.c.

void* TreeRemoveNodeIndex ( Tree aTree,
Node curnode,
int  index 
)

Remove an item from a tree

Parameters
aTreethe list to which the item is to be added
curnodethe list item content itself

Definition at line 420 of file Tree.c.

void TreeRotate ( Tree aTree,
Node curnode,
int  direction,
int  index 
)

Definition at line 147 of file Tree.c.

int TreeStringCompare ( void *  a,
void *  b,
int  content 
)

Definition at line 551 of file Tree.c.

Node * TreeSuccessor ( Node curnode)

Definition at line 330 of file Tree.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49