Top 350+ Solved Data Structures (DS) MCQ Questions Answer

From 256 to 270 of 370

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

Q. In a binary search tree, which of the following traversals would print the numbers in the ascendingorder?

a. Level-order traversal

b. Pre-order traversal

c. Post-order traversal

d. In-order traversal

  • d. In-order traversal

Q. The number of edges from the root to the node is called of the tree.

a. Height

b. Depth

c. Length

d. Width

  • b. Depth

Q. The number of edges from the node to the deepest leaf is called of the tree.

a. Height

b. Depth

c. Length

d. Width

  • a. Height

Q. What is a full binary tree?

a. Each node has exactly zero or two children

b. Each node has exactly two children

c. All the leaves are at the same level

d. Each node has exactly one or two children

  • a. Each node has exactly zero or two children
Subscribe Now

Get All Updates & News