#include #include #include #include #include #include #include #include #ifndef WORDTREE_HPP #define WORDTREE_HPP class WordTree { struct TreeNode { bool m_endOfWord; std::array, 26> m_children; TreeNode(); }; std::shared_ptr m_root; public: WordTree(); ~WordTree(); void add(const std::string& word); bool find(const std::string& word); std::vector predict(std::string partial, std::uint8_t howMany); std::size_t size(); }; #endif // WORDTREE_HPP