retagged by
520 views
1 votes
1 votes

Find the missing statement in the if loop of $Floyd$ algorithm.

Procedure Floyd: (var A: array[1...n,1...n] of real; C: array [1...n,1...n] of real);
Var
i, j, k: integer;
begin M
 for i:=l to n do
 for j:=l to n do
  A[i,j]: =C[i,j]

for i:=l to n do
A[i,j ]:=0 ;
for k:= l to n do
for i:=l to n do
for j:= l to n do

if A[i,j] > A[i,k]+A[k,j] then

____________________
end ;
  1.    $A[i,j]: = A[i,k] + A[k,j]$   
  2.    $A[i,j]: = A[i, j] + A[k,j]$   
  3.    $A[i,j]: = A[j,k]+ A[j,i]$ 
  4.    $A[i,j]: =A[i,k] + A[i,j]$
retagged by

1 Answer

Best answer
3 votes
3 votes
In Floyd-Warshall's algorithm if we have A[i,j] > A[i,k]+A[k,j] then we assign A[i,j] = A[i,k]+A[k,j].

So (A)
selected by
Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked Jan 16, 2017
318 views
How many times $fibon$$\left ( 3 \right )$ is called during invocation of $fibon$ $\left ( 6 \right )$?$fibon(x) = fibon(x-1) + fibon(x-2)$$fibon(0) = 1$$fibon(1) = 1$345...
4 votes
4 votes
2 answers
3
Bikram asked Jan 16, 2017
861 views
Hash a list of $3$ keys into hash table with $20$ locations. What will be the probability of the event $A$ in which hashing the three keys causes a collision?$0.123$$0.14...