Q65Comprehension3 Marks20 Nov 2022
Passage
Let `Z` be a row in the Words table and `D` be a dictionary. Use the procedure below for the subquestions.
```
Procedure updateDict(Z, Dict)
i = 1, x = ""
while(i <= Z.LetterCount) {
x = ith letter of Z.Word
if(not isKey(Dict, x)) {
Dict[x] = 1
}
else {
Dict[x] = Dict[x] + 1
}
i = i + 1
}
return(Dict)
End updateDict
```
Let `X.Word` be "thinking". At the end of execution of the following pseudocode, what will be the value of `length(keys(alphaDict))`?
```
alphabet = {'t': 2, 'e': 1, 'w': 1}
alphaDict = updateDict(X, alphabet)
```
Press Enter to check.