Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago