Science, asked by asifanu8481, 1 year ago

Preorder postorder traversal binary tree

Answers

Answered by Swebo
1
Preorder traversal

Visit root node
Visit all the nodes in the left subtree
Visit all the nodes in the right subtree
display(root->data)
preorder(root->left)
preorder(root->right)

Postorder traversal

Visit all the nodes in the left subtree
Visit the root node
Visit all the nodes in the right subtree
postorder(root->left)
postorder(root->right)
display(root->data)
Similar questions