Recent questions tagged depth-first-search

1 1 vote
1 1 answer
165
165 views
Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason RAssertion A: Depth first search can be used to perform a topological s...
1 1 vote
1 1 answer
137
137 views
Which of the following statements about DFS are correct?It can detect cycles in a graphIt can be used to find connected components.It works for both directed and undirect...
6 6 votes
2 2 answers
979
979 views
Consider a directed graph $G=(V, E)$, where $V$ is the finite set of vertices and $E$ is the set of directed edges between the vertices. $G$ may contain cycles but there ...
10 10 votes
5 5 answers
2.3k
2.3k views
Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph $G(V, E)$ as input, where $d[v]$ and $f[v]$ are the discovery time a...
1 1 vote
1 1 answer
484
484 views
Suppose the input directed graph $G(V,E)$ is a DAG. For an edge $(u,v)\in E$, which of the following will NEVER be correct in DFS discovery/finish times?$d[u] < d[v] < f[...
21 21 votes
6 6 answers
4.9k
4.9k views
Consider a directed graph $G=(V, E)$, where $V=\{0,1,2, \ldots, 100\}$ and $E=\{(i, j): 0<j-i \leq 2$, for all $i, j \in V\}$. Suppose the adjacency list of each vertex i...
37 37 votes
4 4 answers
15.0k
15.0k views
​​​​Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph $G$ is/are TRUE?A DFS tree of $G$ is...
0 0 votes
0 0 answers
925
925 views
Hi everyone.I have a question for everyone as follows:Given a connected undirected graph with N vertices and N edges and an integer K.Print the number of ways to remove e...
22 22 votes
3 answers 3 answers
12.7k
12.7k views
​​​​Consider performing depth-first search (DFS) on an undirected and unweighted graph $G$ starting at vertex $s$. For any vertex $u$ in $G, d[u]$ is the length of the sh...
21 21 votes
8 8 answers
6.9k
6.9k views
​​​​​Consider a state space where the start state is number $1$. The successor function for the state numbered $n$ returns two states numbered $n+1$ and $n+2$. Assume tha...
1 1 vote
1 1 answer
1.0k
1.0k views
Consider performing Depth-First Search (DFS) on an undirected and unweighted graph $\bar{G}$ starting at vertex $S$. For any vertex $u$ in $G$, where $d[u]$ is the length...
2 2 votes
1 1 answer
776
776 views
BFS DFS question asking the number of nodes expanded BFS = DFSBFS $$ DFSNone
0 0 votes
0 0 answers
446
446 views
3 3 votes
3 3 answers
7.6k
7.6k views
Let $\text{b}$ be the branching factor of a search tree. If the optimal goal is reached after $\text{d}$ actions from the initial state, in the worst case, how many times...
0 0 votes
2 2 answers
1.2k
1.2k views
Which of the following statements is/are true?A. In a labelled undirected connected simple graph G, all the depth-first search from same node form same tree.B. In a label...
2 2 votes
1 1 answer
631
631 views
Consider the following graph : For the graph; the following sequences of depth first search (DFS) are given$\text{abcghf}$$\text{abfchg}$$\text{abfhgc}$$\text{afghbc}$Whi...
0 0 votes
1 1 answer
698
698 views
Please list the problems where BFS alone can do and DFS alone can do and both can do??