Q26Comprehension4 Marks16 Oct 2022
Passage
Answer the given subquestions. The subquestions are based on pseudocode executed using the "Olympics" dataset. Assume that every player has won at least two medals and only one medal in any year.
The following pseudocode is executed on the "Olympics" dataset. Use the procedure `doSomething` in the previous question. What will `count` represent at the end of the execution? Assume that every player has won at least two medals and only one medal in a year.
```
count = 0, max = 0
while(Table 1 has more rows){
Read the first row X from Table 1
Move the row X to Table 2
while(Table 1 has more rows){
Read the first row Y from Table 1
if(X.Name == Y.Name){
Move the row Y to Table 2
}
else{
Move the row Y to Table 3
}
}
diff = doSomething(Table 2)
if(diff == max){
count = count + 1
}
if(diff > max){
max = diff
count = 1
}
Delete all the rows from Table 2
Move all the rows from Table 3 to Table 1
}
```