Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Question: Problem 1 : The text book, as well as the instructor, has told you about the order of the two searching algorithms (Linear

Java Question:

Problem 1: The text book, as well as the instructor, has told you about the order of the two searching algorithms (Linear and Binary). The question is do you actually agree with the theoretical representation of the results presented to you? How would you go about proving or disproving what you have been told about the order of algorithms in relation to reality?

a.Create an unsorted array list with 100 random items in it and then perform a linear search on the array list looking for an item that is present in the list. Count the number of comparisons required to find the item in the list.

b.Do the same problem as part a again, but this time look for an item that is not in the list.

c.Create an ordered array list with 100 random items in it and then perform a binary search on the array list looking for an item that is present in the list. Count the number of comparisons required to find the item in the list.

d.Do the same problem as part d again, but this time look for an item that is not in the list.

e.Note to get a true sample, a statistically valid, representation of the results for each of a,b,c,and d must be run at least 10 times, so do this and plot the results on a graph showing how many comparisons are required for each of the options listed above (a through e) and finally you can answer the original question do the practical results match the theoretical results? Note be specific in your answer, and support your conclusion with the data results you have obtained.

Problem 2: The text book, as well as the instructor, has told you about the order of the sorting algorithms (Selection, Insertion, Bubble, Quick, and Merge). The question is do you actually agree with the theoretical representation of the results presented to you? How would you go about proving or disproving what you have been told about the order of algorithms in relation to reality?

a. Create an unsorted array list with 100 random items in it and then sort it. Count the number of comparisons required to sort it. Do this for bubble sort and quick sort and do each algorithm 10 times, and plot the results on a graph showing how many comparisons are required for each of the sorting algorithms and finally you can answer the original question do the practical results match the theoretical results? Note be specific in your answer, and support your conclusion with the data results you have obtained.

It's doesn't have to be coding, just need word explanation, thanks.

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

Step: 3

blur-text-image

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Discuss health care in the global environment.

Answered: 1 week ago