Q49
NAT2 marksAlgorithmsConsider the following algorithm someAlgo that takes an undirected graph as input. someAlgo() 1. Let be any vertex in . Run BFS on starting at . Let be a vertex in at maximum distance from as given by the BFS. 2. Run BFS on again with as the starting vertex. Let be the vertex at maximum distance from as given by the BFS. 3. Output the distance between and in . The output of someAlgo() for the tree shown in the given figure is ___________. (Answer in integer)

Sign in to save attempts.
Keys: Enter checks, ← → move between questions.
Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.