Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 searchesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started