Subject-wise GATE questions

Algorithms

12 questions and papers

GATE CS 2021 Set 1 – Question 36

Multiple choice 2 marks GATE CS — Computer Science & IT 2021

Consider the following recurrence relation:\(T(n) = T(n/2) + T(2n/5) + 7n\) for \(n > 0\), and \(T(0) = 0\).Which one of the following options is correct?

GATE CS 2019 – Question 37

Multiple choice 2 marks GATE CS — Computer Science & IT 2019

There are \(n\) unsorted arrays: \(A_1, A_2, \ldots, A_n\). Assume that \(n\) is odd. Each of \(A_1, A_2, \ldots, A_n\) contains \(n\) distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing…

GATE CS 2018 – Question 14

Multiple choice 1 mark GATE CS — Computer Science & IT 2018

Assume that multiplying a matrix \(G_1\) of dimension \(p \times q\) with another matrix \(G_2\) of dimension \(q \times r\) requires \(pqr\) scalar multiplications. Computing the product of \(n\) matrices \(G_1 G_2 G_3 \ldots G_n\) using dynamic programming, the time…

GATE CS 2017 Set 1 – Question 39

Numerical answer 2 marks GATE CS — Computer Science & IT 2017

A message is made up entirely of characters from the set \(X = \{P, Q, R, S, T\}\). The table of probabilities for each of the characters is shown below.CharacterProbabilityP0.22Q0.34R0.17S0.19T0.08Total1.00If…

GATE CS 2016 Set 2 – Question 36

Numerical answer 2 marks GATE CS — Computer Science & IT 2016

Let \(G\) be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5 and 6. The maximum possible weight that…

GATE CS 2016 Set 1 – Question 12

Multiple choice 1 mark GATE CS — Computer Science & IT 2016

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on

GATE CS 2015 Set 2 – Question 14

Multiple choice 1 mark GATE CS — Computer Science & IT 2015

An unordered list contains \(n\) distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is

GATE CS 2015 Set 1 – Question 34

Multiple choice 2 marks GATE CS — Computer Science & IT 2015

Consider the following array of elements:<89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100>The minimum number of interchanges needed to convert it into a…

GATE CS 2014 Set 2 – Question 38

Numerical answer 2 marks GATE CS — Computer Science & IT 2014

Suppose \(P\), \(Q\), \(R\), \(S\), \(T\) are sorted sequences having lengths 20, 24, 30, 35, 50 respectively. They are to be merged into a single sequence by merging…

GATE CS 2012 – Question 16

Multiple choice 1 mark GATE CS — Computer Science & IT 2012

Let \(W(n)\) and \(A(n)\) denote respectively the worst-case and average-case running time of an algorithm executed on an input of size \(n\). Which of the following is ALWAYS…