#include #include #include #include "trie.h" using namespace std; int main() { //open file of words ifstream infile("words2.txt"); trie T; //read words from file, insert into trie string word; int freq; while (infile >> word) { infile >> freq; T.insert(word); } //create a word completer game while (true) { cout << "Enter a prefix: " << endl; string pre; cin >> pre; cout << "You were about to type: " << T.worstCompletion(pre) << endl; } return 0; }