Top MCQs on Data Structures in DSA with Answers (original) (raw)
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 ?
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 _______.
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)
- 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
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)]
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
Consider the following AO graph:
Which is the best node to expand next by AO* algorithm?
A t-error correcting q-nary linear code must satisfy:
Where M is the number of code words and X is
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.
Given the following prefix expression: * + 3 + 3 ↑ 3 + 3 3 3 What is the value of the prefix expression ?
In how many ways can the string A ∩ B – A ∩ B – A be fully parenthesized to yield an infix expression?
There are 39 questions to complete.
Take a part in the ongoing discussion