edited by
36,329 views
31 votes
31 votes

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:

  1. $\text{MNOPQR}$
  2. $\text{NQMPOR}$
  3. $\text{QMNPRO}$
  4. $\text{QMNPOR}$
edited by

6 Answers

Answer:

Related questions

8.3k
views
3 answers
23 votes
Ishrat Jahan asked Oct 28, 2014
8,316 views
Consider the following sequence of nodes for the undirected graph given below:$a$ $b$ $e$ $f$ $d$ $g$ $c$a$ $b$ $e$ $f$ $c$ $g$ $d$a$ $d$ $g$ $e$ $b$ $c$ $f$a$ $ ... (s)?$1$ and $3$ only$2$ and $3$ only$2, 3$ and $4$ only$1, 2$ and $3$ only
19.0k
views
4 answers
64 votes
Daggerhunt asked Nov 16, 2014
18,960 views
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 vertex in $G$ and let $v$ ... not an edge in $G$ then $u$ and $v$ must have the same parent in $T$
28.3k
views
11 answers
63 votes
Kathleen asked Sep 12, 2014
28,346 views
Dijkstra's single source shortest path algorithm when run from vertex $a$ in the above graph, computes the correct shortest path distance toonly vertex $a$only vertices $a, e, f, g, h$only vertices $a, b, c, d$all the vertices
14.0k
views
6 answers
28 votes
Kathleen asked Sep 11, 2014
13,983 views
The most efficient algorithm for finding the number of connected components in an undirected graph on $n$ vertices and $m$ edges has time complexity$\Theta(n)$\Theta(m)$\Theta(m+n)$\Theta(mn)$