Algorithms questions

Q11

GATE CS 2016 CS-1Graph AlgorithmsNAT1 mark
Consider the following directed graph:

The number of different topological orderings of the vertices of the graph is ________.
Question figure
Show answer without attempting

Answer: 6.0

Q13

GATE CS 2016 CS-1Searching Sorting and HashingMCQ1 mark−1/3 if wrong
The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:
Show answer without attempting

Answer: D

Q14

GATE CS 2016 CS-1Graph AlgorithmsMCQ1 mark−1/3 if wrong
Let GG be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?

P: Minimum spanning tree of GG does not change
Q: Shortest path between any pair of vertices does not change
Show answer without attempting

Answer: A

Q38

GATE CS 2016 CS-1Graph AlgorithmsNAT2 marks
Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j} is given by the entry WijW_{ij} in the matrix WW.

W=[02852058850x58x0]W = \begin{bmatrix} 0 & 2 & 8 & 5 \\ 2 & 0 & 5 & 8 \\ 8 & 5 & 0 & x \\ 5 & 8 & x & 0 \end{bmatrix}

The largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the edge with weight x is ________.
Show answer without attempting

Answer: 12.0

Q39

GATE CS 2016 CS-1Graph AlgorithmsNAT2 marks
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 a minimum weight spanning tree of G can have is ________.
Show answer without attempting

Answer: 7.0

Q40

GATE CS 2016 CS-1Graph AlgorithmsMCQ2 marks−2/3 if wrong
G = (V,E) is an undirected simple graph in which each edge has a distinct weight, and e is a particular edge of G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE?

I. If e is the lightest edge of some cycle in G, then every MST of G includes e
II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e
Show answer without attempting

Answer: B

Q13

GATE CS 2016 CS-2Searching Sorting and HashingMCQ1 mark−1/3 if wrong
Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE?

I. Quicksort runs in Θ(n2)\Theta(n^2) time
II. Bubblesort runs in Θ(n2)\Theta(n^2) time
III. Mergesort runs in Θ(n)\Theta(n) time
IV. Insertion sort runs in Θ(n)\Theta(n) time
Show answer without attempting

Answer: D

Q14

GATE CS 2016 CS-2Graph AlgorithmsMCQ1 mark−1/3 if wrong
The Floyd-Warshall algorithm for all-pair shortest paths computation is based on
Show answer without attempting

Answer: C

Q38

GATE CS 2016 CS-2Algorithm DesignNAT2 marks
Let A1,A2,A3A_1, A_2, A_3, and A4A_4 be four matrices of dimensions 10×510 \times 5, 5×205 \times 20, 20×1020 \times 10, and 10×510 \times 5, respectively. The minimum number of scalar multiplications required to find the product A1A2A3A4A_1 A_2 A_3 A_4 using the basic matrix multiplication method is _________.
Show answer without attempting

Answer: 1500.0

Q41

GATE CS 2016 CS-2Graph AlgorithmsMCQ2 marks−2/3 if wrong
In an adjacency list representation of an undirected simple graph G=(V,E)G = (V,E), each edge (u,v)(u, v) has two adjacency list entries: [v][v] in the adjacency list of uu, and [u][u] in the adjacency list of vv. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If ∣E∣=m|E| = m and ∣V∣=n|V| = n, and the memory size is not a constraint, what is the time complexity of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?
Show answer without attempting

Answer: B

0/100 correct0 marks

Related topics in GATE CS