Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need assistance.. For this, you will solve problems related to efficiency, and the Big O asymptotic notation. SHOW YOUR WORK. The definition of Big O

Need assistance.. For this, you will solve problems related to efficiency, and the Big O asymptotic notation. SHOW YOUR WORK.

The definition of Big O

Let f(n) and g(n) be functions mapping positive integers to positive real numbers. We say that f(n) is O(g(n)) if there is a real constant c > 0 and an integer constant N ? 1 such that:

f(n) ? c * g(n), for n ? N

Note that the constants c and n0 are not unique. You just have to find a c and an N that satisfies the definition of Big O

3.1 Given a time function, T(n) = 3x2 + 5x + 2, find constants c and N that prove that the big O of the growth function T(n) is n2

3.2 Find the Big O of T(n) = 4x3 + 12x2 + 2x + 12. Justify your answer by finding constants c and N

3.3 Find the Big O of the following code:

for(int i = 0; i < n; i++) {

for(int j = 0; j < n; j++) {

System.out.println(Hello!);

}

}

You do not have to find a T(n), or c and N. Just give the Big O, and informally justify your answer.

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

Explain how a variable differs from a constant.

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago