Question: Use Comparable interface and the compareTo function,(do not use Map or tree) just simple array list sort to Write a JAVA program called Count that

Use Comparable interface and the compareTo function,(do not use Map or tree) just simple array list sort to Write a JAVA program called Count that takes an ArrayList of strings and lists the number of occurrences of unique strings as an arrayList in ascending order. You can asume the list of strings is in alphabetical order. Examples: [be, be, is, not, or, the, to, to] becomes [1,1,1,1,2,2] because is, not, or and the each occur once while be and to occur twice [a, a, a, a, a] becomes [5]. Make your comparisons case insensitive, i.e. [a, a, A, a, a] also becomes [5]. Have the user input strings from the console to populate your ArrayList. Assume that the user enters only String values in alphabetical order. Use the sentinal "lSTOP" to signify the end of user inpu

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!