Q44.The following pseudocode is executed using the Olympics dataset. What will `B` represent at the end of execution?
```
D = {}
while(Table 1 has more rows) {
Read the first row X in Table 1
D = updateDict(D, X.Sport)
Move X to Table 2
}
B = findAValue(D)
Procedure updateDict(D, a)
if(isKey(D, a)) {
D[a] = D[a] + 1
}
else {
D[a] = 1
}
return(D)
End updateDict
Procedure findAValue(D)
V = 0
foreach a in keys(D) {
if(D[a] > V) {
V = D[a]
}
}
return(V)
End findAValue
```
Save
Check
Details
Q44
6 Aug 2023
Q44.The following pseudocode is executed using the Olympics dataset. What will `B` represent at the end of execution?
```
D = {}
while(Table 1 has more rows) {
Read the first row X in Table 1
D = updateDict(D, X.Sport)
Move X to Table 2
}
B = findAValue(D)
Procedure updateDict(D, a)
if(isKey(D, a)) {
D[a] = D[a] + 1
}
else {
D[a] = 1
}
return(D)
End updateDict
Procedure findAValue(D)
V = 0
foreach a in keys(D) {
if(D[a] > V) {
V = D[a]
}
}
return(V)
End findAValue
```