diff options
-rw-r--r-- | README.md | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -44,7 +44,7 @@ is required for the final build of the executable file. Before using the functions, allocate dynamic memory in your program. ``` -rb_tree \*new_tree = malloc(sizeof(rb_tree)); +rb_tree *new_tree = malloc(sizeof(rb_tree)); ``` Do not forget to free the allocated memory at the end using: @@ -55,27 +55,27 @@ free(new_tree); ## Interface for managing rb-tree -1. *`void rb_tree_init(rb_tree \*t);`* +- *`void rb_tree_init(rb_tree *t);`* -To fill `new_tree` with initial values. + To fill `new_tree` with initial values. -2. *`node \*rb_tree_create_node(rb_tree \*t, int num);`* +- *`node *rb_tree_create_node(rb_tree *t, int num);`* -Returns a pointer of type `node\*` to the created node (note that the node has -not yet been inserted into the tree). Or NULL if the num value has already been -inserted into the tree. + Returns a pointer of type `node*` to the created node (note that the node has + not yet been inserted into the tree). Or NULL if the num value has already been + inserted into the tree. -3. *`void rb_tree_insert_node(rb_tree \*t, node \*cur_node);`* +- *`void rb_tree_insert_node(rb_tree *t, node *cur_node);`* -4. *`void rb_tree_delete_node(rb_tree \*t, node \*cur_node);`* +- *`void rb_tree_delete_node(rb_tree *t, node *cur_node);`* -5. *`void rb_tree_clear(rb_tree \*t, node \*root);`* +- *`void rb_tree_clear(rb_tree *t, node *root);`* -6. *`node\* rb_tree_search(rb_tree \*t, node \*root, int num);`* +- *`node *rb_tree_search(rb_tree *t, node *root, int num);`* -Returns a node of type `node\*`. If the value was not found into the tree, then the -node will be equal to `t->nil`, otherwise it returns the node with the required value. + Returns a node of type `node*`. If the value was not found into the tree, then the + node will be equal to `t->nil`, otherwise it returns the node with the required value. -7. `void rb_tree_print(rb_tree \*t, node \*root);` +- *`void rb_tree_print(rb_tree *t, node *root);`* -Displaying a binary tree in stdout. + Displaying a binary tree in stdout. |