Skip to content
/ Trie Public

Simple trie implementation to store and manage a large number of strings.

Notifications You must be signed in to change notification settings

leahjlou/Trie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trie interface: Trie.java
Implementation: words.java

This is a very basic (but working) implementation.

This trie basically only supports adding strings and checking if they exist.

A trie is a tree-based data structure designed to store sequences of characters.
Each node stores an array of other nodes, one for each letter in the alphabet.
Each node has a single parent (except for the root of the trie).
A string is stored as a path in the trie from the root.
Each node also stores a count. Nodes that contain the last character in a string
have one added to their count.

Note that strings themselves are never actually stored in the structure -- they 
are implicitly stored in the paths from node to node.

About

Simple trie implementation to store and manage a large number of strings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages