Algorithms_in_C
1.0.0
Set of algorithms implemented in C.
|
11 #define MAXELEMENTS 1000
23 void *elements[MAXELEMENTS];
26 int number_of_elements;
42 int add_item_label(
Dictionary *,
char label[],
void *);
48 int add_item_index(
Dictionary *,
int index,
void *);
void delete_bt(node **root, int ele)
deletion of a node from the tree if the node isn't present in the tree, it takes no action.
Definition: threaded_binary_trees.c:173
int main()
Main funcion.
Definition: binary_search_tree.c:249
Definition: prime_factoriziation.c:25
Node, the basic data structure in the tree.
Definition: binary_search_tree.c:15
void inOrder(node *root)
Traversal procedure to list the current keys in the tree in order of value (from the left to the righ...
Definition: binary_search_tree.c:238
int data
data of the node
Definition: binary_search_tree.c:18
node * newNode(int data)
The node constructor, which receives the key value input and returns a node pointer.
Definition: binary_search_tree.c:28
int data
stores the number
Definition: threaded_binary_trees.c:28
struct Node * rlink
link to right child
Definition: threaded_binary_trees.c:30
Node, the basic data structure of the tree.
Definition: threaded_binary_trees.c:27
int main()
Driver code.
Definition: client.c:70
void postorder_display(node *curr)
performs postorder traversal param[in] curr node pointer to the topmost node of the tree
Definition: threaded_binary_trees.c:143
struct Node node
Node, the basic data structure of the tree.
void search(node *root, int ele)
searches for the element
Definition: threaded_binary_trees.c:98
int find(node *root, int data)
Search procedure, which looks for the input key in the tree and returns 1 if it's present or 0 if it'...
Definition: binary_search_tree.c:152
node * getMax(node *root)
Utilitary procedure to find the greatest key in the left subtree.
Definition: binary_search_tree.c:72
struct Node * llink
link to left child
Definition: threaded_binary_trees.c:29
void preorder_display(node *curr)
performs preorder traversal param[in] curr node pointer to the topmost node of the tree
Definition: threaded_binary_trees.c:157
#define max(a, b)
shorthand for maximum value
Definition: kohonen_som_topology.c:39
struct node * left
left child
Definition: binary_search_tree.c:16
void inorder_display(node *curr)
performs inorder traversal param[in] curr node pointer to the topmost node of the tree
Definition: threaded_binary_trees.c:129
struct node node
Node, the basic data structure in the tree.
node * insert(node *root, int data)
Insertion procedure, which inserts the input key in a new node in the tree.
Definition: binary_search_tree.c:46
node * create_node(int data)
creates a new node param[in] data value to be inserted
Definition: threaded_binary_trees.c:38
void insert_bt(node **root, int data)
inserts a node into the tree param[in,out] root pointer to node pointer to the topmost node of the tr...
Definition: threaded_binary_trees.c:51
int height(node *root)
Utilitary procedure to measure the height of the binary tree.
Definition: binary_search_tree.c:187
struct node * right
right child
Definition: binary_search_tree.c:17
void purge(node *root)
Utilitary procedure to free all nodes in a tree.
Definition: binary_search_tree.c:217
int main()
main function
Definition: threaded_binary_trees.c:255