Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2. (a) If f(n)+g(n) ((n)) and f(n)+ h(n) O(h(n)), use the definition of big O notation to prove that g(n) + h(n) (h(n)) b) Algorithms
Q2. (a) If f(n)+g(n) ((n)) and f(n)+ h(n) O(h(n)), use the definition of big O notation to prove that g(n) + h(n) (h(n)) b) Algorithms Al and A2 are stated to have complexities O(n2) and O(3") respectively. On an input of size n = 10,000 both algorithms run in exactly the same time t = 10 seconds. How much time do you expect each algorithm to take on an input of size i. n= 9.990 ii. n 30,000 (c) An algorithm is said to have complexity O(log (n)). On a trial run, in ten seconds it executes for an input of n-128. Suppose we want to let it run "overnight" (lets say the night is 8 hours long, i.e. 28,800 seconds), what input (i.e. approximate value of n) should we supply
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