Graph Traversals Quiz (original) (raw)

Suppose depth first search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after first checking that the vertex has not been visited earlier. Then the maximum possible recursion depth (including the initial call) is _________.

GATECS2014Q20

Which of the following statement is correct?

P1: Every tree will always be a graph
P2: Every graph will always be trees.
P3: Every tree will be a graph, but every graph will not be a tree
P4: Every graph will be a tree, but every tree will not be a graph.

Identify the following Representation of the graph.

adjacency_mat1

Which data structure is commonly used to implement the navigation system in a mapping application, helping users find the shortest route between locations?

For a given graph G having v vertices and e edges which is connected and has no cycles, which of the following statements is true?

In a directed acyclic graph with a source vertex s, the quality-score of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex v other than s, the quality-score of v is defined to be the maximum among the quality-scores of all the paths from s to v. The quality-score of s is assumed to be 1.

The sum of the quality-scores of all vertices on the graph shown above is _______ .

Consider the following directed graph:

Which of the following is/are correct about the graph?

An articulation point in a connected graph is a vertex such that removing the vertex and its incident edges disconnects the graph into two or more connected components.

Let T be a DFS tree obtained by doing DFS in a connected undirected graph G. Which of the following options is/are correct?

Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph is

In an adjacency list representation of an undirected simple graph G = (V, E), each edge (u, v) has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If |E| = m and |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?

There are 30 questions to complete.

Take a part in the ongoing discussion