a) Suppose that it takes 0.004 seconds to run a program on a te sot of size n 20
ID: 3884270 • Letter: A
Question
a) Suppose that it takes 0.004 seconds to run a program on a te sot of size n 20o. Assume that the number of items in the actual da t oot is 4000- what would be the opec ted run-time (show your work) if the program is applied to the actual data set and the under 1ying algorithn is Assume that it takes 0.0012 seconds to run a program on a teot data set of eizen 50. Assune that the number of items in the actual ata set is 80,000. What would be the expooted run-time (show your work) if the proor am is applied to the actual data set and the underlying algor ithm isi 5 a. OCn) b. o(n) 6. Assume that an algorithm consists of two parte, one part is o(n and the other ia o(n). What is the Big-o run-time for the entire algorithm ? 7. The Paradox of Speed: Suppose that computers become 16 times faster. If the same amount of computer time is to be used, how müch can the data set size be increased if the underlying algorithm is: 2 a. O( n) b. o(n) e. Determine the answer and explain why it is the answer: a. O( n) ( n) b. O( n) +O(n C. 0(log n) + 0(n) = ? 2Explanation / Answer
Hi, as per chegg policy, solving only one question i.e 4, please post others as separate questions,
4. Given it takes 0.002 seconds when n=100
now given, n=10000
a. O(1)- which means constant time and independent of N, so the program will run for 0.002 seconds only for n=10000
b.O(n) - this means it is linearly dependent on n, hence if n is 100 times more, it takes 100 times more than 0.002 i.e 0.2 seconds
c. O(n^2)- this means it is exponentially dependent on n, that is if n is 100 times more, then the time will be 100^2 times i.e 10000 times of 0.002 which is 20 seconds
Thumbs up if this was helpful, otherwise let me know in comments, and please post others as separate questions, we will be happy to answer them. Good Day
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.