Skip to content

Trie

storing

Level 2 of 3

Also called Prefix tree and Digital tree.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from trie's own run on the numbers shown.

choose one

question 1

An empty trie puts in plus, play and plum. How many places does it make?

the answer, and why

the answer is A

Each word makes a place for each letter after the longest start it shares with a word put before it: word by word, 4 + 2 + 1, 7 in all.

if you chose another

  • That is the visits, every letter followed or made.
  • That is the letters followed, not the places made.
  • That is one word's places; the later words make some too.

new numbersthe test page's numbers

question 2

An empty trie puts in den, dew, dent and on. How many letters does it follow?

the answer, and why

the answer is D

Each word follows the letters of the longest start it shares with a word put before it: word by word, 0 + 2 + 3 + 0, 5 in all.

if you chose another

  • That is the places made.
  • That is every letter, followed or made, the visits.
  • That counts the words, not the letters.

new numbersthe test page's numbers

question 3

Which list makes the most places, put into an empty trie?

the answer, and why

the answer is D

tray, trip, trap makes 7 places, the most of the four.

if you chose another

  • That list makes 6 places, fewer than 7.
  • That list makes 5 places, fewer than 7.
  • That list makes 6 places, fewer than 7.

new numbersthe test page's numbers