Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions data_structures/binary_trees/binary_search_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,32 @@ void inOrder(node *root)
}
}

/** Traversal procedure that can be used for copying the tree
* @param root pointer to parent node
*/
void preOrder(node *root)
{
if (root != NULL)
{
printf("\t[ %d ]\t", root->data);
preOrder(root->left);
preOrder(root->right);
}
}

/** Traversal procedure that can be used for delete the tree
* @param root pointer to parent node
*/
void postOrder(node *root)
{
if (root != NULL)
{
postOrder(root->left);
postOrder(root->right);
printf("\t[ %d ]\t", root->data);
}
}

/** Main funcion */
int main()
{
Expand Down