Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Description Food poisoning is a fairly common and entirely unplcasant occurrence. When there is an outbreak of food poisoning, the State Health Department has

Java

image text in transcribed

Description Food poisoning is a fairly common and entirely unplcasant occurrence. When there is an outbreak of food poisoning, the State Health Department has to try to identify the food that is the likely source. They do this by looking for similarities between the list of foods that were eaten by people who have been medically diagnosed as having food poisoning. Suppose that people who have had food foods poisoning had recently eaten the following Food count max alfalfa sprouts bean sprouts Bean Sprouts Lettuce CBgS Ground Beef bean sprouts bean sprouts cabbage Eggs spinach tomatoes Bean sprouts Alfalfa Sprouts Bean Sprouts CBgS bean sprouts2 bean sprouts 3 bean sprouts4 bean sprouts 5 cabbage ground beef 1 lettuce spinach tomatocs Read File The method that performs this task is: public static Stringl] cntcrData(String filename) Change all Words to Lower Case Find the Most Common Lines Finding the most common lines in the file is more challenging. The best strategy is to put the lines in sorted order first, and then count ones that are similar (that will be right next to each other). If we do this with the original data, we will have the left column of the table below To find the most common line in file, you need to count the elements that are identical. The Count variable shows how this would look for this data. We also need to keep track of the biggest count to this point. The max column shows how this could be done. The method signature is: public static String Strinsl] data)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

Describe how theories advance psychological science.

Answered: 1 week ago

Question

What does Verizon say about FiOS cabling used for television?

Answered: 1 week ago