Start learning 50% faster. Sign in now
In an unweighted graph, Breadth-First Search (BFS) is optimal for finding the shortest path in terms of the number of edges. BFS explores all vertices at the current depth level before moving on to the next level, ensuring that the shortest path is found when the destination vertex is first encountered. For unweighted graphs, the edge count represents the path cost, and BFS efficiently identifies the shortest path by expanding vertices layer by layer. Why Other Options Are Incorrect: 1. Depth-First Search (DFS): DFS explores as far as possible along a branch before backtracking, which does not guarantee the shortest path in terms of edges. 2. Dijkstra’s Algorithm: While Dijkstra’s algorithm is used for weighted graphs, it is not necessary for unweighted graphs where BFS suffices. 3. Prim’s Algorithm: Prim’s algorithm is used for finding minimum spanning trees, not shortest paths. 4. Bellman-Ford Algorithm: While Bellman-Ford can handle negative weights, it is computationally expensive compared to BFS for unweighted graphs.
The distance covered by a boat while moving in downstream in a fixed time is 3/4 more than in upstream. The speed of stream is what % of the still water...
The ratio of downstream speed to upstream speed of a boat is 5:3. If the boat can cover 160 km in still water in 10 hours, then find the difference betw...
A man swims downstream 60 km and upstream 36 km, taking 12 hr each time. Find the man’s rate in still water?
The ratio of the speed of boats ‘A’ and ‘B’ in still water is 8:9, respectively. The speed of the current is 25% of the speed of boat ‘A’ in...
A boat covers a distance of 150 km while moving in a downstream in 5 hours. When the boat covers a distance of 60 km in still water in 3 hours, then Wha...
The speed of a boat in still water is 45 km/hr, and the speed of the stream is 5 km/hr. The boat takes 30 minutes longer to cover a distance of x km ups...
Two boats X and Y start towards each other from two places, 155 km apart. Speed of the boat X and Y in still water are 14 km/hr and 17 km/hr respectivel...
The speed of a boat in still water increases by 4 km/hour after each hour. The speed of stream is 3 km/hour. If the boat travelled 60 km in 3 hours in d...
A man’s speed with the current is 50 km/hr and the speed of the current is 5 km/hr. The man’s speed against the current is:
...The speed of a boat in still water is 12 times the speed of the stream. If the difference between the upstream and downstream speed of the boats is 20 k...