Answer by G. Sliepen for Trie implementation using std::shared_ptr
Use std::unique_ptr instead of std::shared_ptrYou are never sharing your std::shared_ptrs, so it is much better to use std::unique_ptr instead. std::unique_ptr uses less memory and is more...
View ArticleTrie implementation using std::shared_ptr
I've implemented a basic Trie that is supposed to work only with lowercase English letters.class TrieNode {public: array<shared_ptr<TrieNode>, 26> children; bool isWord; TrieNode(bool...
View Article
More Pages to Explore .....