Top 80+ Solved Non Linear Data Structures - Trees MCQ Questions Answer

From 16 to 30 of 71

Q. To obtain a prefix expression, which of the tree traversals is used?

a. Level-order traversal

b. Pre-order traversal

c. Post-order traversal

d. In-order traversal

  • b. Pre-order traversal

Q. 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

  • c. T Q O P S R

Q. A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a validpost-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

  • d. 8, 7, 26, 13, 40, 75, 70, 35

Q. 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

  • b. post-order and in-order

Q. A full binary tree can be generated using

a. post-order and pre-order traversal

b. pre-order traversal

c. post-order traversal

d. in-order traversal

  • a. post-order and pre-order traversal

Q. Find the postorder traversal of the binary tree shown below.

a. P Q R S T U V W X

b. W R S Q P V T U X

c. S W T Q X U V R P

d. none

  • c. S W T Q X U V R P

Q. For the tree below, write the in-order traversal.

a. 6, 2, 5, 7, 11, 2, 5, 9, 4

b. 6, 5, 2, 11, 7, 4, 9, 5, 2

c. 2, 7, 2, 6, 5, 11, 5, 9, 4

d. none

  • a. 6, 2, 5, 7, 11, 2, 5, 9, 4

Q. For the tree below, write the level-order traversal.

a. 2, 7, 2, 6, 5, 11, 5, 9, 4

b. 2, 7, 5, 2, 11, 9, 6, 5, 4

c. 2, 5, 11, 6, 7, 4, 9, 5, 2

d. none

  • b. 2, 7, 5, 2, 11, 9, 6, 5, 4

Q. What is the time complexity of level order traversal?

a. O(1)

b. O(n)

c. O(logn)

d. O(nlogn)

  • b. O(n)

Q. Which of the following graph traversals closely imitates level order traversal of a binary tree?

a. Depth First Search

b. Breadth First Search

c. Depth & Breadth First Search

d. Binary Search

  • b. Breadth First Search
Subscribe Now

Get All Updates & News