Q9.The following pseudocode is executed on the "Library" dataset. What is the value of `Count` after the pseudocode below is executed?
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
while(Table 1 has more rows){
Read the first row Y in Table 1
if(verifyPair(X, Y)) {
count = count + 1
}
Move Y to Table 3
}
Move all rows from Table 3 to Table 1
}
Procedure verifyPair(X, Y)
if(X.Genre == Y.Genre and X.Language != Y.Language){
return True
}
else{
return False
}
End verifyPair
```
Save
Check
Details
Q9
23 Feb 2025
Q9.The following pseudocode is executed on the "Library" dataset. What is the value of `Count` after the pseudocode below is executed?
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
while(Table 1 has more rows){
Read the first row Y in Table 1
if(verifyPair(X, Y)) {
count = count + 1
}
Move Y to Table 3
}
Move all rows from Table 3 to Table 1
}
Procedure verifyPair(X, Y)
if(X.Genre == Y.Genre and X.Language != Y.Language){
return True
}
else{
return False
}
End verifyPair
```