What Is A Trie and How Do We Build One In Python?

Опубликовано: 16 Февраль 2026
на канале: Nathan Patnam
17,379
411

Today we are going over what Tries are and how we can implement them in Python in two different ways. If you already know what tries are and want to skip to the implementation, then you can go to 7:35

You can find the code at https://repl.it/@np_tutoring/Trie

If you want to check if a prefix existed in your trie, you could create a method called does_prefix_exist() that would be very similar to does_word_exist(), but you don't have to check if there is a "*" once you iterate through all the letters in the prefix you are looking for.

Follow Me On:
Linkedin:   / nathan-patnam  
Medium:   / nathanpatnam