Chapter quiz · Tries

Test what you learned.

8 questions on Tries. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Tries — Chapter Quiz

Eight questions on trie insert/search complexity, startsWith, when tries beat hash sets, autocomplete, and suffix tries.

0/ 9
  1. Question 1
    1

    What is the time complexity of inserting a word of length m into a trie?

  2. Question 2
    2

    How does a trie implement startsWith(prefix) efficiently?

  3. Question 3
    3

    In which scenario does a trie outperform a hash set of strings?

  4. Question 4
    4

    What does the isEndOfWord (or isLeaf) flag on a trie node signify?

  5. Question 5
    5

    A suffix trie built from a string of length n stores all suffixes. What is its space complexity?

  6. Question 6
    6

    A trie node for an alphabet of size k (e.g., 26 letters) stores exactly k child pointers, but many may be null.

  7. Question 7
    7

    An autocomplete feature that retrieves all words with a given prefix from a trie performs a DFS (or BFS) over the ___ of the prefix's terminal node.

  8. Question 8
    8

    Which of the following are practical applications of tries? (Select all that apply)

    Select all that apply.

Pick an answer — instant feedback as you go.