Q52.Consider the following pseudocode where `Y` is a row in the Words table. At the end of execution, what will be the value of `length(keys(alphaDict))` if `Y.Word` is "think"?
```
alphaDict = {'t': 2, 'e': 1}
alphaDict = updateDict(Y, alphaDict)
Procedure updateDict(Z, Dict)
i = 1
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
```
Save
Check
Details
Q52
2 Apr 2023
Q52.Consider the following pseudocode where `Y` is a row in the Words table. At the end of execution, what will be the value of `length(keys(alphaDict))` if `Y.Word` is "think"?
```
alphaDict = {'t': 2, 'e': 1}
alphaDict = updateDict(Y, alphaDict)
Procedure updateDict(Z, Dict)
i = 1
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
```