Question: If a (2^n) algorithm requires 10 seconds to execute on an input of 10 elements, calculate approximately how long should it take on an input
If a (2^n) algorithm requires 10 seconds to execute on an input of 10 elements, calculate approximately how long should it take on an input of 20 elements? If a (log_2 n) algorithm requires 20 seconds to execute on an input of one million elements, calculate approximately how long should it take on an input of two million elements? If a computer is capable of performing one billion operations per second, calculate approximately how long would it take to execute an algorithm that requires n^2 operations on an input of two million elements? Show all workings!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
