Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following cannot generate the fu... Start Learning for Free
Which of the following cannot generate the full binary tree?
  • a)
    Inorder and Preorder
  • b)
    Inorder and Postorder
  • c)
    Preorder and Postorder
  • d)
    None of the above
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Which of the following cannot generate the full binary tree?a)Inorder ...
To generate a binary tree, two traversals are necessary and one of them must be inorder. But, a full binary tree can be generated from preorder and postorder traversals. Read the algorithm here. Read Can tree be constructed from given traversals?
View all questions of this test
Most Upvoted Answer
Which of the following cannot generate the full binary tree?a)Inorder ...
Explanation:

A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. A full binary tree is a binary tree in which every node has either zero or two children.

Given three traversals of a binary tree, namely inorder, preorder and postorder, it is possible to reconstruct the binary tree. However, not all combinations of two traversals can be used to reconstruct the full binary tree.

a) Inorder and Preorder:
With inorder and preorder traversals, we can construct the tree uniquely. The first node in the preorder traversal is always the root of the tree. We can find this root in the inorder traversal, and all nodes to the left of the root in the inorder traversal are in the left subtree and all nodes to the right of the root in the inorder traversal are in the right subtree. We can then recursively construct the left and right subtrees using the remaining nodes in the preorder traversal.

b) Inorder and Postorder:
With inorder and postorder traversals, we can also construct the tree uniquely. The last node in the postorder traversal is always the root of the tree. We can find this root in the inorder traversal, and all nodes to the left of the root in the inorder traversal are in the left subtree and all nodes to the right of the root in the inorder traversal are in the right subtree. We can then recursively construct the left and right subtrees using the remaining nodes in the postorder traversal.

c) Preorder and Postorder:
With preorder and postorder traversals, it is not possible to construct the tree uniquely. This is because the first node in the preorder traversal is the root and the last node in the postorder traversal is also the root. However, we do not know which subtree comes first, the left or the right.

d) None of the above:
It is not possible to generate the full binary tree with none of the above combinations of traversals because every full binary tree can be reconstructed using either inorder and preorder or inorder and postorder traversals.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following cannot generate the full binary tree?a)Inorder and Preorderb)Inorder and Postorderc)Preorder and Postorderd)None of the aboveCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev