TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation of Trie data structure using HashMap for different characters and method for predicting words based on prefix. More...
#include <cassert>
#include <iostream>
#include <memory>
#include <stack>
#include <unordered_map>
#include <vector>
Go to the source code of this file.
Classes | |
class | data_structures::trie_using_hashmap::Trie |
Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t(UTF-16)type with methods to insert, delete, search, start with and to recommend words based on a given prefix. More... | |
struct | data_structures::trie_using_hashmap::Trie::Node |
struct representing a trie node. More... | |
Namespaces | |
namespace | data_structures |
for IO operations | |
namespace | trie_using_hashmap |
Functions for Trie data structure using hashmap implementation. | |
Functions | |
static void | test () |
Self-test implementations. | |
int | main () |
Main function. | |
Implementation of Trie data structure using HashMap for different characters and method for predicting words based on prefix.
The Trie data structure is implemented using unordered map to use memory optimally, predict_words method is developed to recommend words based on a given prefix along with other methods insert, delete, search, startwith in trie.
Definition in file trie_using_hashmap.cpp.
int main | ( | void | ) |
Main function.
Definition at line 342 of file trie_using_hashmap.cpp.
|
static |
Self-test implementations.
Definition at line 221 of file trie_using_hashmap.cpp.