Skip to content
dsa450for five year olds

Topic 13 of 15

Trie

A tree of letters.

A trie is a tree where each branch is a letter. Words that start the same way share the start of the path, like cat and car sharing c, a. Walking down the letters of a word tells you right away if it, or anything starting with it, is in the tree.

What you will be able to do

Insert and searchPrefix queriesCounting words with a prefixAutocompleteWord break with a trie
0/6
6 problems

Meet the trie

01 / 04

tree

An empty trie is just a root.

  • looking now
  • answer
  • path
  • just added

The problems

In order from easier to harder ideas. The ones marked must do come up in interviews again and again.

Next topicGraph