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.
Five students, Ajay, rani, Seema, Roy and Priya went to foreign on five different months of the year, starting from January and ending on May. Is Ajay t...
How many sons does S have?
I. U is mother of S’s son Q, who has two sisters F and E.
II. There are six family members – two males and ...
Five boys – Sammy, Perry, Pirlo, Anderson and Peter are of different heights. Who among the following is the tallest?
I. Pirlo is taller tha...
Who sit at the corner?
I. P, Q, R, S, T, U are seated in a straight line facing South. R sits third to the right of U and Q sits second to the ri...
Eight boxes M, N, O, P, Q, R, S and T are kept one above the other, such that the bottommost box is numbered as 1, the box above it is numbered as 2 and...
Seven boxes viz. A, B, C, D, E, F and G are kept one above other in the form of stack. How many boxes are kept above box E?
I. Only two boxes a...
Seven boxes A, B, C, D, E, F and G are kept one above the other but not necessarily in the same order. How many boxes are kept below B?
I) �...
In which school does U study among C, D, E, F and G?
I. U does not study in the same school as either S or K.
II. S and K study in school ...
What is the code for ‘red’ in a code language?
I. In the code language ‘beautiful red flowers’ is written as ‘di sa...
A question is given, followed by two statements numbered (I) and (II). You have to decide whether the data provided in the statements is sufficient to ...