Q32Comprehension3 Marks3 Sep 2023
Passage
Consider the directed graph with six nodes shown in the diagram. Let be its adjacency matrix, where if there is an edge from to , and 0 otherwise. Study the given pseudocode and answer the subquestions.
```
Procedure updateMatrix(M)
tempMat = M
foreach i in rows(M){
foreach k in columns(M){
if(M[i][k] == 1){
foreach j in columns(M){
if(M[k][j] == 1){
tempMat[i][j] = 1
}
}
}
}
}
return(tempMat)
End updateMatrix
```

What will be the values of and at the end of execution of the pseudocode given below?
newMatrix = updateMatrix(M)
newMatrix2 = updateMatrix(newMatrix)
A = newMatrix2[0][1]
B = newMatrix2[3][4]