Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve the following practice questions. Please explain your answer so I can understand. Please do not copy anyone else's answer, I can

Please help me solve the following practice questions. Please explain your answer so I can understand. Please do not copy anyone else's answer, I can that if I need to.

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.00x109N, Tbs(N) ~ 1.80 x108 Log(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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions