Question
a. Write the formula for the number of steps to perform k sequential searches on a list of size n f(n,k) = b. Write the
a. Write the formula for the number of steps to perform k sequential searches on a list of size n f(n,k) =
b. Write the formula for the number of steps to perform k binary searches on a list of size n g(n,k) =
c. If we have 10,000 names, how many times do we need to search before Sort+Binary search makes sense (e.g. is less than) over sequential search?
I.e. solve f (10,000,k) < g(10,000,k) (I recommend wolfram alpha!)
c. If we are searching 1,000,000 times, how big does the list need to be to make sorting worth it?
I.e. solve g(n,1,000,000) < f(n,1,000,000)
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