Crack
GATE
C
G
Topic
Searching
Algorithms
0
/ 15 done
Questions per paper
All
MCQ
MSQ
NAT
2015 to 2026. Point at a year to read it.
0
1
2
2015
2019
2021
2023
2025
2026
Show as a table
Year
All
MCQ
MSQ
NAT
2015
0.7
0.3
0
0.3
2018
0
0
0
0
2019
1
0
0
1
2020
1
0
0
1
2021
2
1.5
0.5
0
2022
0
0
0
0
2023
0
0
0
0
2024
0
0
0
0
2025
2
1
0
1
2026
1.5
0
0.5
1
1
CS 2026 Set 1 · 1 mark · MSQ · Moderate
Consider a hash table
P
[
0
,
1
,
…
,
10
]
P[0, 1, \dots, 10]
P
[
0
,
1
,
…
,
10
]
that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is
h
(
x
)
=
(
x
+
7
)
m
o
d
11
h(x) = (x + 7) \bmod 11
h
(
x
)
=
(
x
+
7
)
mod
11
.
2
CS 2026 Set 2 · 1 mark · NAT · Easy
The keys
5
,
28
,
19
,
15
,
26
,
33
,
12
,
17
,
10
5, 28, 19, 15, 26, 33, 12, 17, 10
5
,
28
,
19
,
15
,
26
,
33
,
12
,
17
,
10
are inserted into a hash table using the hash function
h
(
k
)
=
k
m
o
d
9
h(k) = k \bmod 9
h
(
k
)
=
k
mod
9
. The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain is ____. (answer in integer)
3
CS 2026 Set 2 · 1 mark · NAT · Moderate
Consider an array
A
=
[
10
,
7
,
8
,
19
,
41
,
35
,
25
,
31
]
A = [10, 7, 8, 19, 41, 35, 25, 31]
A
=
[
10
,
7
,
8
,
19
,
41
,
35
,
25
,
31
]
. Suppose the merge sort algorithm is executed on array
A
A
A
to sort it in increasing order. The merge sort algorithm will carry out a total of
7
7
7
merge operations.
4
CS 2025 Set 1 · 1 mark · NAT · Moderate
The pseudocode of a function
f
u
n
(
)
\mathbf{fun}()
fun
(
)
is given below:
5
CS 2025 Set 1 · 2 marks · NAT · Moderate
In a double hashing scheme,
h
1
(
k
)
=
k
(
m
o
d
11
)
h_1(k) = k \pmod{11}
h
1
(
k
)
=
k
(
mod
11
)
and
h
2
(
k
)
=
1
+
(
k
(
m
o
d
7
)
)
h_2(k) = 1 + (k \pmod{7})
h
2
(
k
)
=
1
+
(
k
(
mod
7
))
are the auxiliary hash functions. The size
m
m
m
of the hash table is
11
11
11
. The hash function for the
i
i
i
-th probe in the open address table is
[
h
1
(
k
)
+
i
h
2
(
k
)
]
(
m
o
d
m
)
[h_1(k) + i\,h_2(k)] \pmod{m}
[
h
1
(
k
)
+
i
h
2
(
k
)]
(
mod
m
)
. The following keys are inserted in the given order:
63
,
50
,
25
,
79
,
67
,
24
63, 50, 25, 79, 67, 24
63
,
50
,
25
,
79
,
67
,
24
.
6
CS 2025 Set 2 · 1 mark · MCQ · Easy
Consider an unordered list of
N
N
N
distinct integers.
7
CS 2025 Set 2 · 2 marks · MCQ · Moderate
An array
A
A
A
of length
n
n
n
with distinct elements is said to be bitonic if there is an index
1
≤
i
≤
n
1 \le i \le n
1
≤
i
≤
n
such that
A
[
1
…
i
]
A[1 \dots i]
A
[
1
…
i
]
is sorted in the non-decreasing order and
A
[
i
+
1
…
n
]
A[i + 1 \dots n]
A
[
i
+
1
…
n
]
is sorted in the non-increasing order.
8
CS 2021 Set 1 · 1 mark · MCQ · Moderate
Let P be an array containing
n
n
n
integers. Let
t
t
t
be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of
n
n
n
elements. Which one of the following choices is correct?
9
CS 2021 Set 1 · 1 mark · MCQ · Moderate
Consider the following array.
10
CS 2021 Set 1 · 2 marks · MSQ · Hard
Consider a
dynamic
hashing approach for 4-bit integer keys:
11
CS 2021 Set 2 · 1 mark · MCQ · Easy
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size
n
n
n
?
12
CS 2020 · 1 mark · NAT · Easy
Consider a double hashing scheme in which the primary hash function is
h
1
(
k
)
=
k
m
o
d
23
h_1(k) = k \bmod 23
h
1
(
k
)
=
k
mod
23
, and the secondary hash function is
h
2
(
k
)
=
1
+
(
k
m
o
d
19
)
h_2(k) = 1 + (k \bmod 19)
h
2
(
k
)
=
1
+
(
k
mod
19
)
. Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key value
k
=
90
k = 90
k
=
90
is ____.
13
CS 2019 · 1 mark · NAT · Easy
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is ____.
14
CS 2015 Set 2 · 2 marks · MCQ · Moderate
Which one of the following hash functions on integers will distribute keys most uniformly over
10
10
10
buckets numbered
0
0
0
to
9
9
9
for
i
i
i
ranging from
0
0
0
to
2020
2020
2020
?
15
CS 2015 Set 3 · 1 mark · NAT · Easy
Given a hash table
T
T
T
with
25
25
25
slots that stores
2000
2000
2000
elements, the load factor
α
\alpha
α
for
T
T
T
is ____.