0
Traverse the binary tree into preorder, inorder and postorder by giving its algorithm.

enter image description here

binary search tree • 1.1k  views
0
0

The preorder tree traversal’s algorithm is:-

Visit the node.

Traverse the left subtree.

Traverse the right subtree.

The inorder tree traversal’s algorithm is:-

Traverse the left subtree

Visit the node.

Traverse the right subtree.

The postorder tree traversal’s algorithm is:-

Traverse the left subtree.

Traverse the right subtree.

Visit the node.

The preorder traversal is: A-B-D-E-H-I-C-F-G

The inorder traversal is: D-B-H-I-E-A-C-G-F

The postorder traversal is: D-I-H-E-B-G-F-C

0
Please log in to add an answer.

Continue reading

Find answer to specific questions by searching them here. It's the best way to discover useful content.

Find more