Answered step by step
Verified Expert Solution
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
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
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