Question: Code in Java, wirhout the use of hasmaps please!! Problem set #4 Due: Wednesday Feb. 15, 1:00 pm. Relevant topics: asymptotic analysis, lists. An anagram

Code in Java, wirhout the use of hasmaps please!! Code in Java, wirhout the use of hasmaps please!! Problem set \#4

Problem set \#4 Due: Wednesday Feb. 15, 1:00 pm. Relevant topics: asymptotic analysis, lists. An anagram is a word obtained by reordering the letters of another word. For example, "once" and "cone" are anagrams. Note that each letter must be reused exactly once, so anagrams must have the same number of letters. Which word in the English language has the most anagrams? As in the last assignment, let us take "words" to mean words in the file "words.txt". Write a program called MostAnagrams to find the length of a word with the most anagrams. The input to your program is a single line containing a single positive integer n, which is the maximum number of lines to read from words.txt. Your program should print a single integer, the maximum number of anagrams of the words in the first n lines of words.txt. (If n is greater than the number of lines in words.txt, then the output is the same as for n equal to the number of lines in words.txt.) For example, if the input is 8,000 , then a correct output is 5, since albas baals balas balsa basal is the largest set of anagrams in the first 8,000 lines of words.txt. For this problem you may find the String method toChar Array (), the String constructor that takes a character array argument, and the method java.util.Arrays.sort useful. You may also use the Collections.sort() method. You can assume that Collections.sort,( sorts a list of n objects in time O(nlgn). Your program must run in time O(nlgn). Upload your program to Vocareum

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!