Skip to content

This is a simple Java program to demonstrate how to create a Trie dictionary.

Notifications You must be signed in to change notification settings

contactsunny/TrieJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Trie Java Implementation

This is a simple Java program to demonstrate how to create a Trie dictionary for the following tasks:

  • add a word
  • check if a word is present or not
  • delete a word
  • check for word suggestions given a prefix
  • check all the words present in the trie

Output

Adding word 'Sunny'.
Adding word 'Srinidhi' recursively.
------------------------------
Word 'Sunny' present: true
Word 'Srinidhi' present: true
------------------------------
Deleting word 'Sunny'
Word 'Sunny' present: false
Word 'Srinidhi' present: true
------------------------------
Adding word 'Sunny' recursively.
Adding word 'Sun' recursively.
Adding word 'Sunny1' recursively.
------------------------------
Suggestions for prefix 'Su': [Sun, Sunny, Sunny1]
------------------------------
All words present: [Srinidhi, Sun, Sunny, Sunny1]
------------------------------

About

This is a simple Java program to demonstrate how to create a Trie dictionary.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages