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:

Defines

#define NO_HEAP_TRACKING   1
#define LEFT   0
#define RIGHT   1

Functions

int isRed (Node *aNode)
int isBlack (Node *aNode)
void TreeRotate (Tree *aTree, Node *curnode, int direction, int index)
NodeTreeBAASub (Tree *aTree, Node *curnode, int which, int index)
void TreeBalanceAfterAdd (Tree *aTree, Node *curnode, int index)
void * TreeAddByIndex (Tree *aTree, void *content, size_t size, int index)
 Add an item to a tree.
NodeTreeFindIndex1 (Tree *aTree, void *key, int index, int value)
NodeTreeFindContentIndex (Tree *aTree, void *key, int index)
NodeTreeMinimum (Node *curnode)
NodeTreeSuccessor (Node *curnode)
NodeTreeNextElementIndex (Tree *aTree, Node *curnode, int index)
NodeTreeBARSub (Tree *aTree, Node *curnode, int which, int index)
void TreeBalanceAfterRemove (Tree *aTree, Node *curnode, int index)
void * TreeRemoveIndex (Tree *aTree, void *content, int index)
 Remove an item from a tree.
void TreeInitializeNoMalloc (Tree *aTree, int(*compare)(void *, void *, int))
TreeTreeInitialize (int(*compare)(void *, void *, int))
 Allocates and initializes a new tree structure.
void TreeAddIndex (Tree *aTree, int(*compare)(void *, void *, int))
void TreeFree (Tree *aTree)
void * TreeAdd (Tree *aTree, void *content, size_t size)
NodeTreeFindIndex (Tree *aTree, void *key, int index)
NodeTreeFind (Tree *aTree, void *key)
NodeTreeNextElement (Tree *aTree, Node *curnode)
void * TreeRemoveNodeIndex (Tree *aTree, Node *curnode, int index)
 Remove an item from a tree.
void * TreeRemove (Tree *aTree, void *content)
void * TreeRemoveKeyIndex (Tree *aTree, void *key, int index)
void * TreeRemoveKey (Tree *aTree, void *key)
int TreeIntCompare (void *a, void *b, int content)
int TreePtrCompare (void *a, void *b, int content)
int TreeStringCompare (void *a, void *b, int content)

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.


Function Documentation

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

Add an item to a tree.

Parameters:
aTree the list to which the item is to be added
content the list item content itself
size the size of the element

Here is the call graph for this function:

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

Allocates and initializes a new tree structure.

Returns:
a pointer to the new tree structure

Here is the call graph for this function:

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

Remove an item from a tree.

Parameters:
aTree the list to which the item is to be added
curnode the list item content itself

Here is the call graph for this function:

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

Remove an item from a tree.

Parameters:
aTree the list to which the item is to be added
curnode the list item content itself

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Defines

Generated on 2 Jun 2018 for MQTT C Client Libraries Internals by  doxygen 1.6.1