Question: This is to be written in JAVA . The question shows sample code in C++, but the final code should be written in Java 8.
This is to be written in JAVA. The question shows sample code in C++, but the final code should be written in Java 8. Please include screenshots of your input and output, which should match the ones in the question. Thank You!




For this assignment, you will implement a trie (prefix tree) and use it to solve a couple of problems. You will need to implement three class methods: lookup, which returns a boolean indicating whether the target was found; insert, which adds a string to the trie; and remove, which removes a string from the trie (really removes it, instead of just changing the flag). You will also need to implement additional functions: alphabetical, which prints the contents of the trie in alphabetical order; autocomplete, which prints alphabetically all possible words that can be formed by a prefix and k additional characters; and count, which prints the number of words in the trie. For example, in C++, the function headers and trie node would be the following
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
