35/35
Part 7 of 7 · Follow-upsCheck yourself
Check yourself
6 questions
  1. 1.A trie holds tent and tents, and nobody inserted ten. What tells you ten isn't a word?

  2. 2.What does checking whether some word starts with a prefix of p letters cost in a trie of n words?

  3. 3.You count, on every node, the words that pass through it. Which word has no prefix that only it starts with, among tent, tents and tarp?

  4. 4.Autocomplete keeps the best k words on every node. What gets expensive?

  5. 5.Every suffix of yoyo, kayak and pole goes in one trie, and each node counts every visit. What does yoyo get as its shortest unique fragment, and why?

  6. 6.You have a fixed list of 100,000 words and must count the words under a prefix, with memory tight. What would you use?

Now the problem this lesson builds to: 37 A fragment that finds one itemPractice it