Q66.Let `X.Word` and `Y.Word` be "computational" and "thinking" respectively. The following pseudocode is executed using the Words dataset and the procedure `updateDict`. At the end, what is the value of `length(keys(commonDict))`?
```
firstDict = {}, secondDict = {}, commonDict = {}
firstDict = updateDict(X, commonDict)
secondDict = updateDict(Y, commonDict)
foreach key in keys(firstDict) {
if(isKey(secondDict, key)) {
if(firstDict[key] > secondDict[key]) {
commonDict[key] = firstDict[key]
}
else {
commonDict[key] = secondDict[key]
}
}
}
```@passage
Save
Read
Check
Details
Q66
20 Nov 2022
Q66.Let `X.Word` and `Y.Word` be "computational" and "thinking" respectively. The following pseudocode is executed using the Words dataset and the procedure `updateDict`. At the end, what is the value of `length(keys(commonDict))`?
```
firstDict = {}, secondDict = {}, commonDict = {}
firstDict = updateDict(X, commonDict)
secondDict = updateDict(Y, commonDict)
foreach key in keys(firstDict) {
if(isKey(secondDict, key)) {
if(firstDict[key] > secondDict[key]) {
commonDict[key] = firstDict[key]
}
else {
commonDict[key] = secondDict[key]
}
}
}
```@passage