Question: Hi how to do this in python? Exercise 2 - Search for Values in the List It is possible that due to hardware limitations you

 Hi how to do this in python? Exercise 2 - Search

Hi how to do this in python?

Exercise 2 - Search for Values in the List It is possible that due to hardware limitations you may not be able to complete the experiment for the larger data sets. If so, that's ok - just do the largest cases that you can. For this range of values of N:{1000,2000,4000,8000,16000} complete the following steps: 1. Generate a list of N distinct integers. Sort the integers into ascending order. You should be able to write your own sorting function, use a Python built-in sort, or use an implementation from a previous lab. 2. Use linear search to search the array for each of the values in the array. Record the total number of iterations/calls/elapsed time required to conduct the searches. Compute the average number of iterations/calls required to conduct the searches. 3. Use binary search to search the array for each of the values in the array. Record the total number of iterations/calls/elapsed time required to conduct the searches. Compute the average number of iterations/calls required to conduct the searches. 4. Use trinary search to search the array for each of the values in the array. Record the total number of iterations/calls/elapsed time required to conduct the searches. Compute the average number of iterations/calls required to conduct the searches

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!