Q30.The following pseudocode is executed using the "Library" dataset. What will `count` represent at the end of the execution?
```
count = 0
while(Table 1 has more rows){
Read the first row X from Table 1
Move X to Table 2
Flag = True
if(X.Genre != "Fiction"){
Flag = False
}
if(Flag){
while(Table 1 has more rows){
Read the first row Y from Table 1
if(X.Author == Y.Author){
Move Y to Table 2
if(Y.Genre != "Fiction"){
Flag = False
}
}
else{
Move Y to Table 3
}
}
Move all rows from Table 3 to Table 1
}
if(Flag){
count = count + 1
}
}
```
Save
Check
Details
Q30
10 Jul 2022
Q30.The following pseudocode is executed using the "Library" dataset. What will `count` represent at the end of the execution?
```
count = 0
while(Table 1 has more rows){
Read the first row X from Table 1
Move X to Table 2
Flag = True
if(X.Genre != "Fiction"){
Flag = False
}
if(Flag){
while(Table 1 has more rows){
Read the first row Y from Table 1
if(X.Author == Y.Author){
Move Y to Table 2
if(Y.Genre != "Fiction"){
Flag = False
}
}
else{
Move Y to Table 3
}
}
Move all rows from Table 3 to Table 1
}
if(Flag){
count = count + 1
}
}
```