Module pythonnds.trie

Trie, also called digital tree or prefix tree, is a kind of search tree—an ordered tree data structure used to store a dynamic set or associative array where the keys are usually strings.

Classes

class Trie

Class variables

var wordcount

Methods

def add(self, string: str) ‑> NoneType

Add word to the trie structure

def build(self, array: list) ‑> NoneType

Builds a trie structure given array of words

def contains(self, string: str) ‑> bool

Checks if a trie contains a word or substring of word