Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (6 pts) Suppose that we time three functions in Python: linear searching, binary searching, and sorting. We determine their running times, based on the

image text in transcribed

3. (6 pts) Suppose that we time three functions in Python: linear searching, binary searching, and sorting. We determine their running times, based on the length of their list argument as: TIS(N) -6.00x10N, Tbs(N) 1.80 x108 Log2(N), and Ts(N) ~8.00 x107N Log2 N. Suppose that we have a list of size N and we will search it N times (compute the time using these T functions). We can do a linear search each time or we can first sort the data (just once) and then do a binary search each time. How long does it take... (compute logs and show your answer to 3 significant digits, like the coefficients above) al) to do a linear search of 100 values 100 times? a2) to sort 100 values and do a binary search of them 100 times? bl) to do a linear search of 10,000 values 10,000 times? b2) to sort 10,000 values and do a binary search of them 10,000 times? cl) For what problem sizes N is it faster do linear searching? c2) For what problem sizes N is it faster to sort and use binary searching? In problems cl and c2 only, compute your answer to the closest integer value (you can ignore decimal places). Use a calculator, spreadsheet, or a program to compute (possibly to guess and refine) your

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions