Skip to content

GoombaFU/Autocomplete-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autocomplete-Application

Building a word autocomplete application using an alphabet trie

The Trie Class Functions

  • bool Trie::insert(string) – Insert a new word into the trie. Duplicate words are not allowed. This function should return true if the word is successfully inserted into the trie, and false if the word could not be inserted (for example, due to a duplicate word already found in the trie).

  • int Trie::count() – return the number of words in the trie

  • int Trie::getSize() – return the total number of nodes in the trie

  • bool Trie::find(string) – if the given word is found in the trie, this function should return true, otherwise this function should return false

  • int Trie::completeCount(string) – this function should return the number of words in the dictionary that begin with the given input string. If no matching words are found, the function should return zero.

  • vector Trie::complete(string) – this function should return a C++ vector of strings containing all of the words in the dictionary that begin with the given input string. For each word found in the trie, there will be one value in the vector. If no matching words are found, the function should return an empty vector

  • Trie& Trie::operator=(const Trie&) – trie1 = trie2 should remove all contents of trie1 (without memory leaks) and make an independent copy of trie2 in trie1.

  • Copy constructor – must correctly make an independent trie that is an exact copy of the original trie.

About

Building a word autocomplete application using an alphabet trie

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages