Complete GATE CSE 2026 Paper 2 overview, original pages and practice · Timed previous-paper practice

Questions 37–39 of 65. Imported answers require review unless explicitly marked reviewed.

Paper practice 65 questionsPage 13 of 22

Question 37

Open question
CS2MCQ2 marksNeeds review
Let

be a weighted directed acyclic graph with

edges and

vertices. Given

and a source vertex

in

, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from

to all vertices that are reachable from

in

?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 38

Open question
CS2MCQ2 marksNeeds review
Consider an array

of integers of size

. The indices of

run from 1 to

. An algorithm is to be designed to check whether

satisfies the condition given below.

such that

,

Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 39

Open question
CS2MCQ2 marksNeeds review
Consider a table

, where the elements

,

, represent the cost of the optimal solutions of different subproblems of a problem that is being solved using a dynamic programming algorithm. The recursive formulation to compute the table entries is as follows:


Consider the following two algorithms to compute entries of

. Assume that for both the algorithms, for all

,

has been initialized to 1.
Algorithm

: For

For


Algorithm

: For

For

For

If


Algorithm

,

is said to be correct if and only if it calculates the correct values of

, for all

, (as per the recursive formulation at the end of the execution of the algorithm

).
Which one of the following statements is true?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer