# Tag Archives: Graph Traversals

## Print all shortest paths between given source and destination in an undirected graph

Given an undirected and unweighted graph and two nodes as source and destination, the task is to print all the paths of the shortest length… Read More »

## Nodes with prime degree in an undirected Graph

Given an undirected graph with N vertices and M edges, the task is to print all the nodes of the given graph whose degree is… Read More »

## Algorithms | Graph Traversals | Question 12

If the DFS finishing time f[u] > f[v] for two vertices u and v in a directed graph G, and u and v are in… Read More »

## Algorithms | Graph Traversals | Question 12

Is following statement true/false? A DFS of a directed graph always produces the same number of tree edges, i.e., independent of the order in which… Read More »

## Algorithms | Graph Traversals | Question 12

Is following statement true/false If a DFS of a directed graph contains a back edge, any other DFS of the same graph will also contain… Read More »

## Algorithms | Graph Traversals | Question 9

Which of the following condition is sufficient to detect cycle in a directed graph? (A) There is an edge from currently being visited node to… Read More »

## Algorithms | Graph Traversals | Question 8

Given two vertices in a graph s and t, which of the two traversals (BFS and DFS) can be used to find if there is… Read More »

## Algorithms | Graph Traversals | Question 9

Make is a utility that automatically builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the… Read More »

## Algorithms | Graph Traversals | Question 12

Consider the following graph, Among the following sequences: (I) a b e g h f (II) a b f e h g (III) a b… Read More »

## Algorithms | Graph Traversals | Question 12

Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a… Read More »

## Algorithms | Graph Traversals | Question 12

The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is… Read More »

## Algorithms | Graph Traversals | Question 12

What are the appropriate data structures for following algorithms? 1) Breadth First Search                        … Read More »

## Algorithms | Graph Traversals | Question 2

Traversal of a graph is different from tree because (A) There can be a loop in graph so we must maintain a visited flag for… Read More »

## Algorithms | Graph Traversals | Question 1

Which of the following algorithms can be used to most efficiently determine the presence of a cycle in a given graph ? (A) Depth First… Read More »