5 #define MAX_NUMBER_OF_NODES 255 25 new_node->
next = *head;
36 next_node = (*head)->
next;
60 return (head ==
NULL) ? 1 : 0;
95 new_node->
left = *head;
107 next_node = (*head)->
left;
133 if(val < (*tree)->data)
135 insert(&(*tree)->left, val);
137 else if(val > (*tree)->data)
139 insert(&(*tree)->right, val);
154 printf(
"%d\n", current->
data);
176 current = current->
left;
183 printf(
"%d\n", current->
data);
184 current = current->
right;
203 if(!prev || prev->
left == curr || prev->
right == curr)
210 else if(curr->
left == prev)
217 printf(
"%d\n", curr->
data);
236 if(!prev || prev->
left == curr || prev->
right == curr)
243 else if(curr->
left == prev)
260 if(tree ==
NULL || tree->
data == val)
264 return search(tree->
right, val);
266 return search(tree->
left, val);
288 printf(
"Pre Order Display\n");
291 printf(
"In Order Display\n");
294 printf(
"Post Order Display\n");
298 tmp = search(root, 4);
301 printf(
"Searched node=%d\n", tmp->
data);
305 printf(
"Data Not found in tree.\n");
309 tmp = search(root, 6);
312 printf(
"Second searched node=%d\n", tmp->
data);
316 printf(
"Data Not found in tree.\n");
void push(node_stack **head, void *t)
void * top(node_stack *head)
_Bool isEmpty(node_stack *head)
node_tree * pop_tree_free_list(node_tree **head)
void print_preorder(node_tree *root)
void __builtin_bambu_time_start()
void init_tree_free_list()
void init_stack_free_list()
void insert(node_tree **tree, int val)
static node_stack StaticPoolStack[MAX_NUMBER_OF_NODES]
static node_tree * head_tree_free_list
#define MAX_NUMBER_OF_NODES
void push_stack_free_list(node_stack **head, node_stack *new_node)
node_tree * __attribute__((noinline))
void print_inorder(node_tree *root)
static node_tree StaticPoolTree[MAX_NUMBER_OF_NODES]
void push_tree_free_list(node_tree **head, node_tree *new_node)
void * pop(node_stack **head)
void print_postorder(node_tree *root)
node_stack * pop_stack_free_list(node_stack **head)
void deltree(node_tree *root)
static node_stack * head_stack_free_list
void __builtin_bambu_time_stop()