C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
|
Contains definitions of routines supported by tree. More...
Go to the source code of this file.
Functions | |
void | tree_insert_node_bst (t_gen d, t_gen data) |
Add element to a bst tree More... | |
t_gen | tree_delete_node_bst (t_gen d, t_gen data) |
Delete a node in a bst tree More... | |
int | tree_height_bst (t_gen n) |
get height of bst More... | |
t_gen | tree_find_node (t_gen d, t_gen data) |
find an element in tree More... | |
t_gen | tree_node_predecessor (t_gen d, t_gen data) |
find the predecessor of a given node in tree More... | |
t_gen | tree_node_successor (t_gen d, t_gen data) |
find the successor of a given node in tree More... | |
t_gen | tree_get_min (t_gen root) |
get min node in tree More... | |
t_gen | tree_get_max (t_gen root) |
get max node in tree More... | |
void | tree_inorder (t_gen d) |
inorder traverse tree More... | |
void | tree_preorder (t_gen d) |
preorder traverse tree More... | |
void | tree_postorder (t_gen d) |
postorder traverse tree More... | |
void | print_tree (t_gen d) |
print tree info level by level More... | |
int | tree_node_count (t_gen d) |
get_num_nodes in tree; More... | |
void | tree_insert_node_avl (t_gen d, t_gen data) |
Add element to an avl tree More... | |
t_gen | tree_delete_node_avl (t_gen d, t_gen data) |
Delete a node in an avl tree More... | |
int | tree_height_avl (t_gen n) |
get height of avl subtree More... | |
void | destroy_tree (t_gen d) |
Destroy the instance of the tree More... | |
t_gen | create_tree (char *name, e_treetype ttype, t_dparams *prm) |
Create an instance of tree More... | |
t_gen | tree_get_min_rcrs (t_gen root) |
get min node in tree recursively More... | |
t_gen | tree_get_max_rcrs (t_gen root) |
get max node in tree recursively More... | |
int | tree_slope (t_gen n) |
get slope of node subtree More... | |
void | tree_rotate_right (t_gen n) |
rotate subtree right More... | |
void | tree_rotate_left (t_gen n) |
rotate subtree left More... | |
void | tree_rebalance (t_gen n) |
rebalance subtree More... | |
Variables | |
f_ins | tree_insert [] = {tree_insert_node_bst,tree_insert_node_avl} |
Look Up function ptrs for inserting elem to tree. More... | |
f_del | tree_del [] = {tree_delete_node_bst,tree_delete_node_avl} |
Look Up function ptrs for deleting elem to tree. More... | |
f_len | tree_height [] = {tree_height_bst, tree_height_avl} |
Look Up function ptrs for getting height of tree. More... | |
Contains definitions of routines supported by tree.
Definition in file tree.c.
t_gen create_tree | ( | char * | name, |
e_treetype | ttype, | ||
t_dparams * | prm | ||
) |
void destroy_tree | ( | t_gen | d | ) |
void print_tree | ( | t_gen | d | ) |
int tree_height_avl | ( | t_gen | n | ) |
int tree_height_bst | ( | t_gen | n | ) |
void tree_inorder | ( | t_gen | d | ) |
int tree_node_count | ( | t_gen | d | ) |
void tree_postorder | ( | t_gen | d | ) |
void tree_preorder | ( | t_gen | d | ) |
void tree_rebalance | ( | t_gen | n | ) |
void tree_rotate_left | ( | t_gen | n | ) |
void tree_rotate_right | ( | t_gen | n | ) |
int tree_slope | ( | t_gen | n | ) |
f_del tree_del[] = {tree_delete_node_bst,tree_delete_node_avl} |
f_len tree_height[] = {tree_height_bst, tree_height_avl} |
f_ins tree_insert[] = {tree_insert_node_bst,tree_insert_node_avl} |