Data Structures & AlgorithmsHardAmazon OA · Tries

The words car, card, care, cat, dog, dot, do are inserted into an initially empty trie. How many nodes does the trie contain, not counting the root?

  1. A. 10
  2. B. 7
  3. C. 12
  4. D. 17

Correct answer: A. 10

Distinct prefixes: c, ca, car, card, care, cat, d, do, dog, dot = 10.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic