Computer Science and Information Technology
GATE CSE Algorithms PYQs
Build your understanding with focused practice from past exam papers.
Questions 61–70 of 84. Imported answers require independent review unless marked reviewed.
Question 23
Open questionCSNAT1 markNeeds review
Consider a double hashing scheme in which the primary hash function is
, and the secondary hash function is
. 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
is ________.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 answerQuestion 31
Open questionCSMCQ2 marksNeeds review
Let
be a weighted, undirected graph and let
be a Minimum Spanning Tree (MST) of
maintained using adjacency lists. Suppose a new weighted edge
is added to
. The worst case time complexity of determining if
is still an MST of the resultant graph isYour 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 answerQuestion 40
Open questionCSMCQ2 marksNeeds review
Let
be a directed, weighted graph with weight function
. For some function
, for each edge
, define
as
. Which one of the options completes the following sentence so that it is TRUE? “The shortest paths in
under
are shortest paths under
too, ________.”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 answerQuestion 41
Open questionCSMCQ2 marksNeeds review
In a balanced binary search tree with
elements, what is the worst case time complexity of reporting all elements in range
? Assume that the number of reported elements is
.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 answerQuestion 49
Open questionCSNAT2 marksNeeds review
Consider a graph
where
,
, and weight of the edge
is
. The weight of minimum spanning tree of
is ______.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 answerQuestion 52
Open questionCSNAT2 marksNeeds review
Graph
is obtained by adding vertex
to
and making
adjacent to every vertex of
. The minimum number of colours required to edge-colour
is ______.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 answerQuestion 12
Open questionCSMCQ1 markNeeds review
Let
be an undirected complete graph on
vertices, where
. Then the number of different Hamiltonian cycles in
is equal toYour 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 answerQuestion 20
Open questionCSNAT1 markNeeds review
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 ________.
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 answerQuestion 25
Open questionCSNAT1 markNeeds review
Consider a sequence of 14 elements:
. The subsequence sum
. Determine the maximum of
, where
. (Divide and conquer approach may be used.)Answer: ________.
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 answerQuestion 37
Open questionCSMCQ2 marksNeeds review
There are
unsorted arrays:
. Assume that
is odd. Each of
contains
distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing the median of the medians of
isYour 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