Q23Multiple correct6 Marks1 Sep 2024
The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of the most frequent vowel in the dataset. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).
```
D = {}, A = 0
while(Table 1 has more rows){
Read the first row X in Table 1
D = updateDictionary(D, X)
Move X to Table 2
}
foreach c in keys(D){
if(c is a vowel and D[c] < A){
A = D[c]
}
}
12
Procedure updateDictionary(D, Y)
i = 1
while(i <= Y.LetterCount){
B = ith letter in Y.Word
if(not isKey(D, B)){
D[B] = D[B] + 1
}
else{
D[B] = 1
}
i = i + 1
}
return(D)
End updateDictionary
```
INSTRUCTIONS
MCQ - Single correct answer only. Selecting more than one answer will be treated as wrong.
MSQ - One or more answers may be correct. Partial marking may apply.
SA - Numerical or short text answer. Enter the exact value.
Comprehension - Read the passage or pseudocode carefully before attempting sub-parts.
For code-based questions - read every line carefully; the difference between options may be a single operator, variable, or indentation.
marks tables, diagrams, flowcharts, or visuals that must be referred to from the original question image.
Original screenshot question numbers have been ignored and the paper has been renumbered sequentially.