Question: How Long Does It Take? Suppose we know how the time it takes to solve a problem ( like finding a needle in a haystack

How Long Does It Take?
Suppose we know how the time it takes to solve a problem (like finding a needle in a haystack) depends on the size of its input (for example, the number of pieces of hay in the haystack).
For example, suppose we knew that the time required using technique A for haystack searching was exactly the number of pieces of hay in milliseconds (one one thousandth of a second).
if we had a haystack with one million pieces of hay, how long would it take to find the needle? time =1\times 10 x 10-3 seconds =10* seconds = about 16minutes
What if I had a technique for looking for needles in a haystack that only took log n milliseconds for n pieces of hay? In my million piece haystack I'd have found that needle in 6 milliseconds!
Now imagine you have other techniques for searching hay stacks. For each of them we know how the number of milliseconds it takes to find the needle depends on the number of pieces of hay in the stack. These are given by the expressions below.
Q3. How much time does each technique require if the hay stack has million pieces of hay?
A./n
B.n x log(n)
C.n?
D.n
E.2"
F.n!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!