Create an unsorted array list with 100 random items in it


Problem : 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.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create an unsorted array list with 100 random items in it
Reference No:- TGS02897348

Expected delivery within 24 Hours