Ask Question
3 July, 22:36

The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder traversal of the binary tree is:

(A) d e b f g c a

(B) e d b g f c a

(C) e d b f g c a

(D) d e f g b c a

+4
Answers (2)
  1. 4 July, 00:54
    0
    The correct answer to the following question will be Option A (d e b f g c a).

    Explanation:

    In the given question the binary tree is missing, so the question is incomplete. The complete question will be:

    a

    / /

    b c

    / / / /

    d e f g

    Now coming to the answer:

    In this tree we are applying the post order algorithm for traversing the tree is given below:

    Step 1: Go to the left-subtree.

    Step 2: Go to the right-subtree.

    Step 3: Print the data.

    The root 'a' is follow the algorithm Post order After applying the algorithm it comes to the node 'b', 'b' is also follow the Post order algorithm then it comes to 'd', after applying the algorithm Post order it prints 'd'. Similarly all the node follow the same algorithm.
  2. 4 July, 02:03
    0
    Option (A)

    Explanation:

    In the post order traversal, we always print left subtree, then right subtree and then the root of the tree. In preorder traversal, First the root is printed, then, left subtree and at last, right subtree, so, the first element in preorder is the root of the tree and we can find elements of left sub tree from in order as all the elements written left to the root will of left subtree and similarly the right one. This is how repeating it will give the post order traversal.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder traversal of the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers