Q15Comprehension4 Marks22 Dec 2024
Passage
Consider a graph generated from the "Scores" table that is represented by a matrix B. Each node in the graph corresponds to a student from the table. SeqNo is used to label the nodes in the graph. Study the given pseudocode and answer the given subquestions.
```
A = {}
while(Table 1 has more rows){
Read the first row X in Table 1
A[X.SeqNo] = [X.City/Town, X.Gender]
Move X to Table 2
}
n = length(keys(A))
M = createMatrix(n, n)
foreach i in keys(A){
foreach j in keys(A){
if(i != j and isRelated(A[i], A[j])){
M[i][j] = 1
}
}
}
Procedure isRelated(x, y)
if(first(x) == first(y) or last(x) == last(y)){
return(True)
}
else{
return(False)
}
End isRelated
```
There is an edge between students i and j, with i != j, if and only if: