Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

6. Conclude with the same strength as in the introduction

Answered: 1 week ago

Question

7. Prepare an effective outline

Answered: 1 week ago