retagged by
1,657 views

1 Answer

3 votes
3 votes
For DFS take a node, we have (n-1) possible tree edges, next we have all possible (n-2) tree edges,.......finally 1 possible tree edge. and we can choos any of n nodes as rooot node. hence no of distinct DFS trees= n*(n-1)*(n-2)*....*1=n!

 

For BFS tree if we take a node as root, we have to explore all its neighbors , so the number distinct of BFS trees =no of nodes we can choose as root ie. n .

Related questions

1 votes
1 votes
1 answer
1
Shreya Roy asked Feb 28, 2017
304 views
If a graph has k-independent components, it it n-k+1 colorable
6 votes
6 votes
3 answers
2
sh!va asked Jul 20, 2016
636 views
There are 16072016 users in Facebook. A graph is formed where an edge(u,v) is defined when a male is friend to a female and vice versa. Estimate the number of simple cycl...
0 votes
0 votes
1 answer
4
Rajnish Kumar asked May 4, 2017
565 views
I don't know programming EXCEPT some basics of C which r in GATE syllabus.NOW I'm shortlisted for IIT KANPUR written exam.M worry about programming test.how'll I success ...