Q47Comprehension4 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 using the "Olympics" dataset. Procedure `doSomething` accepts a Table of rows which contains rows of the same player. Assume that every player has won at least two medals and only one medal in any year. What will `(B - A)` represent at the end of the execution?
```
Procedure doSomething(Table T1)
A = 0, B = 0
while(Table T1 has more rows){
Read the first row Z from Table T1
if(Z.Year > A){
B = A
A = Z.Year
}
if(Z.Year < A and Z.Year > B){
B = Z.Year
}
Move the row Z to Table T2
}
return(A - B)
End doSomething
```