Postorder Traversal Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Postorder Traversal Multiple choice Questions and Answers (MCQs)

Question 1
In postorder traversal of binary tree right subtree is traversed before visiting root.
A
True
B
False
Data interpretation (DI) Questions answers
Question 1 Explanation: 
Post-order method of traversing involves - i) Traverse left subtree in post-order, ii) Traverse right subtree in post-order, iii) visit the root.

Question 2
What is the possible number of binary trees that can be created with 3 nodes, giving the sequence N, M, L when traversed in post-order.
A
15
B
3
C
5
D
8
Reasoning Questions answers
Question 2 Explanation: 
5 binary trees are possible and they are,

Question 3
The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be .....
A
T Q R S O P
B
T O Q R P S
C
T Q O P S R
D
T Q O S P R
English literature Questions answers
Question 3 Explanation: 
The last, second last nodes visited in post-order traversal are root and it's right child respectively. Option T Q R S O P can't be a pre-order traversal, because nodes O, P are visited after the nodes Q, R, S. Option T O Q R P S, can't be valid, because the pre-order sequence given in option T O Q R P S and given post-order traversal creates a tree with node T as root and node O as left subtree. Option T Q O P S R is valid. Option T Q O S P R is not valid as node P is visited after visiting node S.

Question 4
A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a valid post-order sequence of the tree provided the pre-order sequence as 35, 13, 7, 8, 26, 70, 40 and 75?
A
7, 8, 26, 13, 75, 40, 70, 35
B
26, 13, 7, 8, 70, 75, 40, 35
C
7, 8, 13, 26, 35, 40, 70, 75
D
8, 7, 26, 13, 40, 75, 70, 35
Microbiology Questions answers
Question 4 Explanation: 
The binary tree contains values 7, 8, 13, 26, 35, 40, 70, 75. The given pre-order sequence is 35, 13, 7, 8, 26, 70, 40 and 75. So, the binary search tree formed is

Thus post-order sequence for the tree is 8, 7, 26, 13, 40, 75, 70 and 35.

Question 5
Which of the following pair's traversals on a binary tree can build the tree uniquely?
A
post-order and pre-order
B
post-order and in-order
C
post-order and level order
D
level order and preorder
Puzzles Questions answers
Question 5 Explanation: 
A binary tree can uniquely be created by post-order and in-order traversals.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<