Ready to begin
No records have been processed. Start with Next step.

Follow the dictionary as its keys and values change. Predict each lookup or update before revealing the next step.
Ready
No records have been processed. Start with Next step.
Predict the next key, whether it already exists, and the value that will be stored.
lengthCount = {}
foreach X in words {
k = X.LetterCount
if (isKey(lengthCount,k)) {
lengthCount[k] = lengthCount[k] + 1
}
else {
lengthCount[k] = 1
}
}| LetterCount | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|
| Word-card frequency | 11 | 16 | 10 | 2 | 7 | 4 | 4 | 5 | 4 | 2 |
Use the provided LetterCount field. The Word field retains punctuation, so counting the visible characters of “morning.” is a different calculation. Repeated word occurrences each count once. There are 10 observed length keys and 65 word records. The most frequent length is 3, with 16 occurrences.
A bar chart can put observed lengths in numerical order and frequencies on the vertical axis. That ordering is a presentation step; it does not require dictionary storage to be sorted. A missing length key means no observed occurrence under this counting rule.
What does lengthCount[3]=16 mean?
Sixteen word cards have supplied LetterCount 3. It is not the third word’s length.
What should the frequencies sum to?
65, the number of word cards.
If “the” appears many times, do we count it once?
No. This is a frequency of word-card occurrences, not a count of distinct spellings.