Programming and data structures
CSE - Programming and data structures - Questions and solutions
Question:-
Option (A)
m x n
Option (B)
Maximum of m, n
Option (C)
Minimum of m, n
Option (D)
m + n -1
Correct Option:
D
Question Solution:
Each comparison puts one element in the final sorted array. In the worst case m + n -1 comparisons are necessary
Question:-
Option (A)
2 deletions and 3 additions
Option (B)
3 deletions and 2 additions
Option (C)
3 deletions and 3 additions
Option (D)
3 deletions and 4 additions
Correct Option:
Question:-
Option (A)
16
Option (B)
12
Option (C)
6
Option (D)
10
Correct Option:
Question:-
Option (A)
11
Option (B)
12
Option (C)
13
Option (D)
14
Correct Option:
Question:-
If the sequence of operations – push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop, are performed on a stack, the sequence of popped out values are
Option (A)
2, 2, 1, 1, 2
Option (B)
2, 2, 1, 2, 2
Option (C)
2, 1, 2, 2, 1
Option (D)
2, 1, 2, 2, 2
Correct Option:
Question:-
Option (A)
4
Option (B)
5
Option (C)
6
Option (D)
3
Correct Option:
Question Solution:
It will be one more than the size of the biggest cluster (which is 4) in the this case. This is because, assume a search key hashing onto bun 8. By linear probing the next location for searching is bin 9. Then 0, then 1. If all these resulted in a miss, we try at bin 2 and stop as it is vacant. This logic may not work if deletion is done before the search.