• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Data Structures in DSA with Answers

Question 21

If h is chosen from a universal collection of hash functions and is used to hash n keys into a table of size m, where n ≤ m, the expected number of collisions involving a particular key x is less than _______.
  • 1
  • 1/n
  • 1/m
  • n/m

Question 22

Below are the few steps given for scan-converting a circle using Bresenham’s Algorithm. Which of the given steps is not correct ?
  • Compute d = 3 – 2r (where r is radius)
  • Stop if x > y
  • If d < 0, then d = 4x + 6 and x = x + 1
  • If d ≥ 0, then d = 4 ∗ (x – y) + 10, x = x + 1 and y = y + 1

Question 23

Consider a line AB with A = (0, 0) and B = (8, 4). Apply a simple DDA algorithm and compute the first four plots on this line.
  • [(0, 0), (1, 1), (2, 1), (3, 2)]
  • [(0, 0), (1, 1.5), (2, 2), (3, 3)]
  • [(0, 0), (1, 1), (2, 2.5), (3, 3)]
  • [(0, 0), (1, 2), (2, 2), (3, 2)]

Question 24

The minimum number of scalar multiplication required, for parenthesization of a matrix-chain product whose sequence of dimensions for four matrices is <5, 10, 3, 12, 5> is
  • 630
  • 580
  • 480
  • 405

Question 25

Consider the following AO graph: 56 Which is the best node to expand next by AO* algorithm?
  • A
  • B
  • C
  • B and C

Question 26

A t-error correcting q-nary linear code must satisfy: 65 Where M is the number of code words and X is
  • qn
  • qt
  • q-n
  • q-t

Question 27

Consider the following statements: S1: A queue can be implemented using two stacks. S2: A stack can be implemented using two queues. Which of the following is correct?
  • S1 is correct and S2 is not correct.
  • S1 is not correct and S2 is correct.
  • Both S1 and S2 are correct.
  • Both S1 and S2 are incorrect.

Question 28

Given the following prefix expression: * + 3 + 3 ↑ 3 + 3 3 3 What is the value of the prefix expression ?
  • 2178
  • 2199
  • 2205
  • 2232

Question 29

In how many ways can the string A ∩ B – A ∩ B – A be fully parenthesized to yield an infix expression?

  • 15

  • 14

  • 13

  • 12

Question 30

Consider a source with symbols A, B, C, D with probabilities 1/2, 1/4, 1/8, 1/8 respectively. What is the average number of bits per symbol for the Huffman code generated from above information ?
  • 2 bits per symbol
  • 1.75 bits per symbol
  • 1.50 bits per symbol
  • 1.25 bits per symbol

There are 39 questions to complete.

Last Updated :
Take a part in the ongoing discussion