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

enter image description here

binary search tree • 968 views
ADD COMMENTlink
modified 17 days ago by gravatar for Sanket Shingote Sanket Shingote ♦♦ 290 written 3.5 years ago by gravatar for Sayali Bagwe Sayali Bagwe2.5k
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

ADD COMMENTlink
written 3.5 years ago by gravatar for Sayali Bagwe Sayali Bagwe2.5k
Please log in to add an answer.