Question
Which of the following algorithms is best suited for
finding the shortest path in a weighted graph where some edges may have negative weights but no negative cycles?Solution
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.
Study the given pattern carefully and select the letter from among the given options that can replace the question mark
In the following question, four letter pairs are given. The letters on left side of (–) is related to the letters on the right side of (–) with som...
Select the figure from the options that can replace the question mark (?) and complete the given pattern.
For an integer n, n!=n.(n-1).(n-2). ... 3.2 .1. Then 1! +2!+3!+...+ 100! when divided by 5 leaves remainder _________.
What will come in the place of the question mark (?) in the following equation if ‘+’ and ‘-’ are interchanged and ‘x’ and ‘÷’ are inte...
Which figure should replace the question mark (?) if the following figure series were to be continued?
Select the number from among the given options that can replace the question mark (?) in the following series.
3, 16, 51, 104, ?

Select the option that represents the letters that, when sequentially placed from left to right in the blanks below, will complete the letter series.
Seven boxes numbered 1 to 7 are placed one above the other but not necessarily in the same order. Box-7 is placed immediately below box 5. Box-1 is the ...