Implementing partial search using Trie in Java | Teknology
The partial search or auto complete is usually implemented by data structure called Trie or more improved version of Trie such as Prefix Trie or Compressed Trie. I am going to create a simple example to show how we can implement Partial search using Trie in Java.
In this case the Trie is created before search is done. The root node of the Trie contains the alphabets which are starting alphabets of the each word in our word list. Word list is the list of all words upon which we are going to search. And each node has n child where n is number of possible next characters.
So to create a Trie we will add all words in the Trie and then start searching for the words from it using prefix.
If we have words such as :
JavaOne
JavaTwo
JavaThree
JavaFour
JavaFive
Read full article from Implementing partial search using Trie in Java | Teknology
No comments:
Post a Comment