Question: input 1: I ate dinner We had a three course meal Brad came to dinner with us He loves fish tacos In the end, we





input 1: I ate dinner We had a three course meal Brad came to dinner with us He loves fish tacos In the end, we all felt like we ate too much We all agreed; it was a magnificent evening She is in a loveless relationship We have wall
puzzle 1 : w o r l d a a d e f l b t d e l a d e r a b d e r
please answer this question as related to documents,language must be java , thanks
In this homework, you are expected to implement tric data structure and following functions. First of all, you should create a tri data structure, then you should insert all words in the given txt files, read from user. Finally, you should complete following functions: Boolean Search(String arg): This function should retur true if given argument is in your trie, otherwise it should return false. Void autoComplete(String prefix): This function should print all strings start with given prefix in your trie, lexicographically. Void reverseAutoComplete(String suffix): This function should print all strings end with given suffix in your trie, lexicographically. For this function, you may consider using multi-trie solution, or research and use more complex data structures such as suffix arrays. 1 Void FullAutoComplete(String prefix, String suffix): This function should print all strings start with given prefix and end with given suffix in your tric, lexicographically. For this function, you may consider using multi-trie solution, or research and use more complex data structures such as suffix arrays. Void find TopK(int k): This function should print top k words that have most occurrences, lexicographically. For this function, you may use a symbol table that keeps track of the number of appearances of each key. Void SolvePuzzle(String filepath): This function should read input from the given filepath and print all possible words in your trie Example file.puzzlel.txt, is as follow: (Each character in the given .txt file is separated with one space character.) world a adef Ibtde lader abder You can move horizontally, vertically, and diagonally in the given grid. You should find and print all valid words in your trie such as "world", "water", "wall" etc, lexicographically. Example inputs and outputs: Let input.txt has following lines: I ate dinner We had a three course meal Brad came to dinner with us He loves fish tacos In the end, we all felt like we ate too much We all agreed, it was a magnificent evening She is in a loveless relationship We have wall 2. 1-) Search Inputi.txt (enter words file) 1 (represents search function) (enter search word) Input1.bxt (enter words file) (represents search function) had (enter search word) 1 Ate True True Input1.txt (enter words file) (represents search function) world (enter search word) 1 Input1.bt (enter words file) (represents search function) (enter search word) 1 money False False 2-) AutoComplete Inputi.txt (enter words file) (represents autocomplete function) 2 2 Input1.bt (enter words fille) (represents autocomplete function) (enter auto-completed word) loveless, loves a (enter auto-completed word) lov a, agreed, all, ate Inputi.txt (enter words file) 2 (represents autocomplete function) (enter auto-completed word) asds No words 3-) ReverseAutoComplete Input1.bxt (enter words file) 3 (represents reverse autocomplete function) (enter reverse auto-completed word) is, loveless, loves, tacos, us, was 5 3 Inputi.txt (enter words file) (represents reverse autocomplete function) (enter reverse auto-completed word) GX No word 4-)FullComplete Inputi.txt (enter words file) 4 (represents full autocomplete function) (enter full auto-completed words, prefix and suffix respectively.) thee three Input1.txt (enter words file) 4 (represents full autocomplete function) (enter full auto-completed words, prefix and suffix respectively.) thc ee No word 5-) findTopk 5 Inputi.txt (enter words file) (represents find top function) (enter number ) 2 a, we 6-) SolvePuzzle 6 Inputi.txt (enter words file) (represents solve puzzle function) puzzle1.txt (enter puzzle file) a, all, ate, wall 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
