Start learning 50% faster. Sign in now
The Bellman-Ford Algorithm (C) is best suited for finding the shortest path in graphs that may have negative weights but no negative cycles. It works by relaxing the edges up to (V-1) times, where V is the number of vertices, ensuring it can handle negative weights and detect negative cycles. Why Other Options Are Wrong: A) Dijkstra's Algorithm: Dijkstra’s algorithm is faster than Bellman-Ford for graphs with non-negative weights but fails when negative weights are present, as it assumes all edge weights are positive. B) Kruskal's Algorithm: This is a Minimum Spanning Tree (MST) algorithm used to connect all nodes in a graph with minimum weight, not to find the shortest path between two nodes. D) Prim’s Algorithm: Like Kruskal’s, Prim’s algorithm is used for finding an MST, not for finding the shortest path in a graph with negative weights. E) Floyd-Warshall Algorithm: This algorithm computes shortest paths between all pairs of vertices and works for both positive and negative weights, but it is not optimal for solving single-source shortest path problems.
If the sum of two numbers is 33 and their difference is 15, the smaller number is
If a = 12, b = 23, c = 34, ............... z = 2627. How many zeros are formed after multiply a × b &t...
Find the least number to be added to the largest 3-digit number which leaves remainder 6 when divided by 4, 5, and 7 so that the result becomes a perfec...
The remainder obtained on dividing a number 'N' by 4 is 3, Find the remainder 'N + 9' is divided by '4'.
The ages of Geeta, Meera and Tina are in the ratio of 6:4:7 respectively. If the sum of their ages is 34 years, what is Meera’s age?
If the largest three – digit number is subtracted from the smallest five – digit number, then the remainder is
Twin prime numbers are the prime numbers whose difference is always equal to 2. The number of twin primes between 35 and 100 is: