Topics in Data Structures

Filter by year

Data Structures questions

Q18

GATE DA 2025 DAData StructuresMCQ1 mark−1/3 if wrong

Report a problem with Q18

What is wrong?
Consider a hash table of size 10 with indices {0,1,…,9}\{0, 1, \ldots, 9\}, with the hash function
h(x)=3x(mod10),h(x) = 3x \pmod{10},
where linear probing is used to handle collisions. The hash table is initially empty and then the following sequence of keys is inserted into the hash table: 1, 4, 5, 6, 14, 15. The indices where the keys 14 and 15 are stored are, respectively
Show answer without attempting

Loading the answer…

Q64

GATE DA 2025 DAData StructuresNAT2 marks

Report a problem with Q64

What is wrong?
Consider the following pseudocode.
Create empty stack S
Set x=0, flag=0, sum=0
Push x onto S
while (S is not empty){
    if (flag equals 0){
        Set x = x+1
        Push x onto S}
    if (x equals 8):
        Set flag=1
    if (flag equals 1){
        x = Pop(S)
        if (x is odd):
            Pop(S)
        Set sum = sum + x}
}
Output sum
The value of sum output by a program executing the above pseudocode is __________ (Answer in integer)
Show answer without attempting

Loading the answer…

0/20 correct0 marks

Related topics in Programming Data Structures and Algorithms