Typedefs | |
typedef _gdsl_bintree_t | _gdsl_bstree_t |
GDSL low-level binary search tree type. | |
typedef int(* | gdsl_bstree_map_func_t )(_gdsl_bstree_t TREE, void *USER_DATA) |
GDSL low-level binary search tree map function type. | |
Functions | |
_gdsl_bstree_t | _gdsl_bstree_alloc (const gdsl_element_t E) |
Create a new low-level binary search tree. | |
void | _gdsl_bstree_free (_gdsl_bstree_t T, const gdsl_free_func_t FREE_F) |
Destroy a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_copy (const _gdsl_bstree_t T, const gdsl_copy_func_t COPY_F) |
Copy a low-level binary search tree. | |
bool | _gdsl_bstree_is_empty (const _gdsl_bstree_t T) |
Check if a low-level binary search tree is empty. | |
bool | _gdsl_bstree_is_leaf (const _gdsl_bstree_t T) |
Check if a low-level binary search tree is reduced to a leaf. | |
gdsl_element_t | _gdsl_bstree_get_content (const _gdsl_bstree_t T) |
Get the root content of a low-level binary search tree. | |
bool | _gdsl_bstree_is_root (const _gdsl_bstree_t T) |
Check if a low-level binary search tree is a root. | |
_gdsl_bstree_t | _gdsl_bstree_get_parent (const _gdsl_bstree_t T) |
Get the parent tree of a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_get_left (const _gdsl_bstree_t T) |
Get the left sub-tree of a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_get_right (const _gdsl_bstree_t T) |
Get the right sub-tree of a low-level binary search tree. | |
ulong | _gdsl_bstree_get_size (const _gdsl_bstree_t T) |
Get the size of a low-level binary search tree. | |
ulong | _gdsl_bstree_get_height (const _gdsl_bstree_t T) |
Get the height of a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_insert (_gdsl_bstree_t *T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE, int *RESULT) |
Insert an element into a low-level binary search tree if it's not found or return it. | |
gdsl_element_t | _gdsl_bstree_remove (_gdsl_bstree_t *T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE) |
Remove an element from a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_search (const _gdsl_bstree_t T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE) |
Search for a particular element into a low-level binary search tree. | |
_gdsl_bstree_t | _gdsl_bstree_search_next (const _gdsl_bstree_t T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE) |
Search for the next element of a particular element into a low-level binary search tree, according to the binary search tree order. | |
_gdsl_bstree_t | _gdsl_bstree_map_prefix (const _gdsl_bstree_t T, const gdsl_bstree_map_func_t MAP_F, void *USER_DATA) |
Parse a low-level binary search tree in prefixed order. | |
_gdsl_bstree_t | _gdsl_bstree_map_infix (const _gdsl_bstree_t T, const gdsl_bstree_map_func_t MAP_F, void *USER_DATA) |
Parse a low-level binary search tree in infixed order. | |
_gdsl_bstree_t | _gdsl_bstree_map_postfix (const _gdsl_bstree_t T, const gdsl_bstree_map_func_t MAP_F, void *USER_DATA) |
Parse a low-level binary search tree in postfixed order. | |
void | _gdsl_bstree_write (const _gdsl_bstree_t T, const gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write the content of all nodes of a low-level binary search tree to a file. | |
void | _gdsl_bstree_write_xml (const _gdsl_bstree_t T, const gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write the content of a low-level binary search tree to a file into XML. | |
void | _gdsl_bstree_dump (const _gdsl_bstree_t T, const gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Dump the internal structure of a low-level binary search tree to a file. |
|
GDSL low-level binary search tree type. This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. Definition at line 51 of file _gdsl_bstree.h. |
|
GDSL low-level binary search tree map function type.
Definition at line 59 of file _gdsl_bstree.h. |
|
Create a new low-level binary search tree. Allocate a new low-level binary search tree data structure. Its root content is sets to E and its left and right sons are set to NULL.
|
|
Copy a low-level binary search tree. Create and return a copy of the low-level binary search tree T using COPY_F on each T's element to copy them.
|
|
Dump the internal structure of a low-level binary search tree to a file. Dump the structure of the low-level binary search tree T to OUTPUT_FILE. If WRITE_F != NULL, then use WRITE_F function to write T's nodes content to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
|
|
Destroy a low-level binary search tree. Flush and destroy the low-level binary search tree T. If FREE_F != NULL, FREE_F function is used to deallocate each T's element. Otherwise nothing is done with T's elements.
|
|
Get the root content of a low-level binary search tree.
|
|
Get the height of a low-level binary search tree. Compute the height of the low-level binary search tree T (noted h(T)).
|
|
Get the left sub-tree of a low-level binary search tree.
|
|
Get the parent tree of a low-level binary search tree.
|
|
Get the right sub-tree of a low-level binary search tree.
|
|
Get the size of a low-level binary search tree.
|
|
Insert an element into a low-level binary search tree if it's not found or return it. Search for the first element E equal to VALUE into the low-level binary search tree T, by using COMP_F function to find it. If an element E equal to VALUE is found, then it's returned. If no element equal to VALUE is found, then E is inserted and its root returned.
|
|
Check if a low-level binary search tree is empty.
|
|
Check if a low-level binary search tree is reduced to a leaf.
|
|
Check if a low-level binary search tree is a root.
|
|
Parse a low-level binary search tree in infixed order. Parse all nodes of the low-level binary search tree T in infixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then _gdsl_bstree_map_infix() stops and returns its last examinated node.
|
|
Parse a low-level binary search tree in postfixed order. Parse all nodes of the low-level binary search tree T in postfixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then _gdsl_bstree_map_postfix() stops and returns its last examinated node.
|
|
Parse a low-level binary search tree in prefixed order. Parse all nodes of the low-level binary search tree T in prefixed order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then _gdsl_bstree_map_prefix() stops and returns its last examinated node.
|
|
Remove an element from a low-level binary search tree. Remove from the low-level binary search tree T the first founded element E equal to VALUE, by using COMP_F function to compare T's elements. If E is found, it is removed from T.
|
|
Search for a particular element into a low-level binary search tree. Search the first element E equal to VALUE in the low-level binary search tree T, by using COMP_F function to find it.
|
|
Search for the next element of a particular element into a low-level binary search tree, according to the binary search tree order. Search for an element E in the low-level binary search tree T, by using COMP_F function to find the first element E equal to VALUE.
|
|
Write the content of all nodes of a low-level binary search tree to a file. Write the nodes contents of the low-level binary search tree T to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F.
|
|
Write the content of a low-level binary search tree to a file into XML. Write the nodes contents of the low-level binary search tree T to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then use WRITE_F function to write T's nodes contents to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
|