Algorithms questions

Q2

GATE CS 2020 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
For parameters aa and bb, both of which are ω(1)\omega(1), T(n)=T(n1/a)+1T(n) = T(n^{1/a}) + 1, and T(b)=1T(b) = 1.

Then T(n)T(n) is
Show answer without attempting

Answer: A

Q6

GATE CS 2020 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
What is the worst case time complexity of inserting n2n^2 elements into an AVL-tree with nn elements initially?
Show answer without attempting

Answer: C

Q23

GATE CS 2020 CSSearching Sorting and HashingNAT1 mark
Consider a double hashing scheme in which the primary hash function is h1(k)=k mod 23h_1(k) = k \bmod 23, and the secondary hash function is h2(k)=1+(k mod 19)h_2(k) = 1 + (k \bmod 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=90k = 90 is __________.
Show answer without attempting

Answer: 13

Q31

GATE CS 2020 CSGraph AlgorithmsMCQ2 marks−2/3 if wrong
Let G=(V,E)G = (V, E) be a weighted undirected graph and let TT be a Minimum Spanning Tree (MST) of GG maintained using adjacency lists. Suppose a new weighted edge (u,v)∈V×V(u, v) \in V \times V is added to GG. The worst case time complexity of determining if TT is still an MST of the resultant graph is
Show answer without attempting

Answer: D

Q40

GATE CS 2020 CSGraph AlgorithmsMCQ2 marks−2/3 if wrong
Let G=(V,E)G = (V, E) be a directed, weighted graph with weight function w:E→Rw: E \rightarrow \mathbb{R}. For some function f:V→Rf: V \rightarrow \mathbb{R}, for each edge (u,v)∈E(u, v) \in E, define w′(u,v)w'(u, v) as w(u,v)+f(u)−f(v)w(u, v) + f(u) - f(v).

Which one of the options completes the following sentence so that it is TRUE?

“The shortest paths in GG under ww are shortest paths under w′w' too, __________.”
Show answer without attempting

Answer: A

Q49

GATE CS 2020 CSGraph AlgorithmsNAT2 marks
Consider a graph G=(V,E)G = (V, E), where V={v1,v2,…,v100}V = \{v_1, v_2, \ldots, v_{100}\}, E={(vi,vj)∣1≤i<j≤100}E = \{(v_i, v_j) \mid 1 \le i < j \le 100\}, and weight of the edge (vi,vj)(v_i, v_j) is ∣i−j∣|i - j|. The weight of minimum spanning tree of GG is __________.
Show answer without attempting

Answer: 99

0/60 correct0 marks

Related topics in GATE CS