Question
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
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