Sunday 20 September 2020

 

Tree Traversals    

1 - What is common in three different types of traversals (Inorder, Preorder and Postorder)?

A Root is visited before right subtree
B Left subtree is always visited before right subtree
C Root is visited after left subtree
D All of the above
E None of the above

2 - 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


3 - Which of the following pairs of traversals is not sufficient to build a binary tree from the given traversals?


A Preorder and Inorder

B Preorder and Postorder

C Inorder and Postorder

D None of the Above


4 - Which traversal of tree resembles the breadth first search of the graph?


A Preorder

B Inorder

C Postorder

D Level order


5 - Which of the following tree traversal uses a queue data structure?

A Preorder

B Inorder

C Postorder

D Level order


6 - Which of the following cannot generate the full binary tree?

A Preorder and Inorder

B Preorder and Postorder

C Inorder and Postorder

D None of the Above

No comments:

Post a Comment