Multiple choice

Find out the postorder traversal of the binary tree if the preorder traversal is I J K L M N and inorder traversal is K J I M L N.

  1. K J I N M L

  2. K J M N L I

  3. M N L K J I

  4. N M K L J I

  5. N M L K I J

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct postorder traversal of the binary tree. Here, we first create the tree using preorder and inorder traversal. Then, find out postorder traversal. First select root from the given preorder that is I. Now, select its left subtree nodes and the right subtree nodes from inorder. We continue to apply this process until all nodes are not finished.