GATE||Alogrithm ||Pyq (2010 to 2025)

Last Updated :
Discuss
Comments

Question 1

Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001n2  time units and package B requires 10nlog10n time units to process n records. What is the smallest value of k for which package B will be preferred over A?
GATE CSE 2010 - [1Marks] (MCQ)

  • 12

  • 10

  • 6

  • 5

Question 2

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij  in the matrix W below is the weight of the edge

{i, j}.

Screenshot-2025-04-28-001142
.

What is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?
GATE CSE 2010 - [2Marks] (MCQ)

  • 7

  • 8

  • 9

  • 10

Question 3

Screenshot-2025-11-20-151021
.

What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T?

GATE CSE 2010 - [2Marks] (MCQ)

  • 7

  • 8

  • 9

  • 10

Question 4

The weight of a sequence a0 , a1 , …, an–1  of real numbers is defined as a0  + a1 / 2 + …+ a n–1 /2n–1 . A subsequence of a sequence is obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let X denote the maximum possible weight of a subsequence of a0 , a1 ,..., an-1 . Then X is equal to
GATE CSE 2010 - [2Marks] (MCQ)


  • max(Y, a0 + Y)

  • max(Y, a0 + Y/2)

  • max(Y, a0 + 2Y)

  • a0 + Y/2

Question 5

A hash table of length 10 uses open addressing with hash function h(k) = k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.

0


1


2

42

3

23

4

34

5

52

6

46

7

33

8


9


Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
GATE CSE 2010 - [1Marks] (MCQ)

  • 46, 42, 34, 52, 23, 33

  • 34, 42, 23, 52, 33, 46

  • 46, 34, 42, 23, 52, 33

  • 42, 46, 33, 23, 34, 52

Question 6

A hash table of length 10 uses open addressing with hash function h(k) = k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below

0


1


2

42

3

23

4

34

5

52

6

46

7

33

8


9


Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
GATE CSE 2010 - [1Marks] (MCQ)

  • 46, 42, 34, 52, 23, 33

  • 34, 42, 23, 52, 33, 46

  • 46, 34, 42, 23, 52, 33

  • 42, 46, 33, 23, 34, 52

Question 7

A hash table of length  10 uses open addressing with hash function h(k)=k mod 10 , and linear probing. After inserting 6 values into an empty hash table, the table is shown as below

Screenshot-2025-11-19-153504
hashtable


How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?

GATE CSE 2010 - [2Marks] (MCQ)

  • 10

  • 20

  • 30

  • 40

Question 8

Which of the given options provides the increasing order of asymptotic complexity of functions f 1 , f 2 , f 3  and f 4 ?

f1 (n) = 2 n      f2 (n) = n 3/2       f3 (n) = nlog2n       f4 (n) = n log 2 n

GATE CSE 2011 - [1Marks] (MCQ)

  • f 3 , f 2 , f 4 , f 1

  • f 3 , f 2 , f 1 , f 4

  • f 2 , f 3 , f 1 , f 4

  • f 2 , f 3 , f 4 , f 1

Question 9

Four matrices M1, M2, M3 and M4 of dimensions pxq, qxr, rxs and sxt respectively can be multiplied is several ways with different number of total scalar multiplications. For example, when multiplied as ((M1 X M2) X (M3 X M4)), the total number of multiplications is pqr + rst + prt.  If p = 10, q = 100, r = 20, s = 5 and t = 80, then the number of scalar multiplications needed is:

GATE CSE 2011 - [2Marks] (MCQ)


  • 248000

  • 44000

  • 19000

  • 25000

Question 10

An undirected graph G(V,E) contains n (n > 2) nodes named v1, v2... vn. Two nodes v i , v j  are connected if and only if 0 < | i- j | < = 2 .  Each edge ( vi, vj )is assigned a weight i + j. A sample graph with n = 4 is shown below.

Screenshot-2025-04-28-124135
.

What will be the cost of the minimum spanning tree (MST) of such a graph with 11 nodes?
GATE CSE 2011 - [2Marks] (MCQ)

  • 1 / 11 ( 11 n2 - 5n )


  • n2 - n + 1

  • 6n - 11

  • 2n + 1

There are 107 questions to complete.

Take a part in the ongoing discussion