Q4Comprehension5 Marks31 Aug 2025
Passage
Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0. ListV represents the list of vertices of the graph G.
Based on the above data, answer the given subquestion.

Consider the below pseudocode. Which of the following statement(s) is/are correct about newMatrix?
```
Procedure updateMatrix(M)
tempMat = M
foreach i in ListV{
foreach j in ListV{
foreach k in ListV{
if(M[i][j] == 1 and M[j][k] == 1){
foreach l in ListV{
if(M[k][l] == 1){
tempMat[i][l] = 1
}
}
}
}
}
}
return(tempMat)
End updateMatrix
newMatrix = updateMatrix(M)
```