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

From 241 to 255 of 370

Q. What operation does the following diagram depict?

a. inserting a leaf node

b. inserting an internal node

c. deleting a node with 0 or 1 child

d. none

  • c. deleting a node with 0 or 1 child

Q. How many bits would a succinct binary tree occupy?

a. n+O(n)

b. 2n+O(n)

c. n/2

d. n

  • b. 2n+O(n)

Q. Using what formula can a parent node be located in an array?

a. (i+1)/2

b. (i-1)/2

c. i/2

d. 2i/2

  • b. (i-1)/2

Q. Which of the following properties are obeyed by all three tree – traversals?

a. Left subtrees are visited before right subtrees

b. Right subtrees are visited before left subtrees

c. Root node is visited before left subtree

d. Root node is visited before right subtree

  • a. Left subtrees are visited before right subtrees

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

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

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

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

d. none

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

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

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

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

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

d. none

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

Q. What is the time complexity of pre-order traversal in the iterative fashion?

a. O(1)

b. O(n)

c. O(logn)

d. O(nlogn)

  • b. O(n)

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
Subscribe Now

Get All Updates & News