java question:
A) Task: Read in text from a file (consisting of words separated by whitespace) and write out to a new file the text with all the words in a reverse order. For example, if my input file has: My output file should have: don’t stop believing hold on to that feeling feeling that to on hold believing stop don’t (Don’t worry about punctuation, you may treat it as part of a word.) (Also don’t worry about preserving whether the whitespace was spaces or newlines, etc. Your output may just use spaces.) Implement this task twice (in two different classes): once using an ArrayList, and once using a LinkedList. For each of your implementations, implement your algorithm such that your code will be as efficient as possible. To meet this requirement, these two solutions will not look the same. (For fun, after you write your solutions, you could test your two implementations and see how they compare. To do this, you might want to create a very large test file so you can observe if there is any noticeable efficiency difference.) B) Task: Read in text from a file and output (to the screen, the number of unique words in the file, and then print out the unique words in alphabetical order. (Note: String’s built-in default ordering is alphabetical.) Your implementation should be as efficient as possible. Show transcribed image text A) Task: Read in text from a file (consisting of words separated by whitespace) and write out to a new file the text with all the words in a reverse order. For example, if my input file has: My output file should have: don’t stop believing hold on to that feeling feeling that to on hold believing stop don’t (Don’t worry about punctuation, you may treat it as part of a word.) (Also don’t worry about preserving whether the whitespace was spaces or newlines, etc. Your output may just use spaces.) Implement this task twice (in two different classes): once using an ArrayList, and once using a LinkedList. For each of your implementations, implement your algorithm such that your code will be as efficient as possible. To meet this requirement, these two solutions will not look the same. (For fun, after you write your solutions, you could test your two implementations and see how they compare. To do this, you might want to create a very large test file so you can observe if there is any noticeable efficiency difference.) B) Task: Read in text from a file and output (to the screen, the number of unique words in the file, and then print out the unique words in alphabetical order. (Note: String’s built-in default ordering is alphabetical.) Your implementation should be as efficient as possible.
Expert Answer
Answer to A) Task: Read in text from a file (consisting of words separated by whitespace) and write out to a new file the text wit…