1,447 views
1 1 vote
What is maximum possible height of BFS tree,if BSF is run on complete bipartisan graph Km,n where m>=1,n>=1 and starting vertex is S

1 Answer

Best answer
1 1 vote
The height is $2$.

Let, $U$ & $V$ be two sets of vertices and $S\in U$. Then, all the vertices of $V$ are enqued making height = 1. All vertices are enqued because the graph is complete. After 1st dequeue, all vertices of $U$ are again enqued making height = 2. Now, all vertices have been into queue therefore no more increment in height possible.
• selected by
Position:
Show:

Related questions

10 10 votes
1 1 answer
294
294 views
GO Classes asked Jul 28
294 views
A binary tree has:$1000$ nodes in the left subtree $100$ nodes in the right subtreeHow many nodes are processed before the root in preorder, inorder, and postorder traver...
7 7 votes
1 1 answer
190
190 views
GO Classes asked Jul 13
190 views
Which of the following functions correctly returns the total number of nodes in a binary tree rooted at $\texttt{t}$?int tree_size(TreeNode *t) { if (t == NULL) return 0;...
11 11 votes
1 1 answer
244
244 views
GO Classes asked Jul 11
244 views
Which of the following can be the number of nodes in a complete binary tree?$2$ $5$ $7$ $8$