Data Structure and Algorithms (DSA) MCQs with answers Page - 80

Here, you will find a collection of MCQ questions on Data Structure and Algorithms (DSA). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. What is the maximum height of an AVL tree with p nodes?

  • (A) p
  • (B) log(p)
  • (C) log(p)/2
  • (D) P⁄2

A

Admin • 833.24K Points
Coach

Q. Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations?

  • (A) just build the tree with the given input
  • (B) find the median of the set of elements given, make it as root and construct the tree
  • (C) use trial and error
  • (D) use dynamic programming to build the tree

A

Admin • 833.24K Points
Coach

Q. What maximum difference in heights between the leafs of a AVL tree is possible?

  • (A) log(n) where n is the number of nodes
  • (B) n where n is the number of nodes
  • (C) 0 or 1
  • (D) atmost 1

A

Admin • 833.24K Points
Coach

Q. What is missing?

  • (A) Height(w-left), x-height
  • (B) Height(w-right), x-height
  • (C) Height(w-left), x
  • (D) Height(w-left)

A

Admin • 833.24K Points
Coach

Q. Why to prefer red-black trees over AVL trees?

  • (A) Because red-black is more rigidly balanced
  • (B) AVL tree store balance factor in every node which costs space
  • (C) AVL tree fails at scale
  • (D) Red black is more efficient

A

Admin • 833.24K Points
Coach

Q. Which of the following is the most widely used external memory data structure?

  • (A) AVL tree
  • (B) B-tree
  • (C) Red-black tree
  • (D) Both AVL tree and Red-black tree

A

Admin • 833.24K Points
Coach

Q. B-tree of order n is a order-n multiway tree in which each non-root node contains

  • (A) at most (n – 1)/2 keys
  • (B) exact (n – 1)/2 keys
  • (C) at least 2n keys
  • (D) at least (n – 1)/2 keys

A

Admin • 833.24K Points
Coach

Q. A B-tree of order 4 and of height 3 will have a maximum of keys.

  • (A) 255
  • (B) 63
  • (C) 127
  • (D) 188

A

Admin • 833.24K Points
Coach

Q. Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are written?

  • (A) 14
  • (B) 7
  • (C) 11
  • (D) 5

A

Admin • 833.24K Points
Coach

Q. trees are B-trees of order 4. They are an isometric of trees.

  • (A) AVL
  • (B) AA
  • (C) 2-3
  • (D) Red-Black