i. How many times the above statement will be exe ii. Write down the Big-O for the above statement? ii. Write down the name of the growth rate.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 2SA
icon
Related questions
icon
Concept explainers
Question
a. Consider the following statements.
for(int k=0; k <A, k++) {
System out println(k);
for(int i=0; i<A; i*=2) {
System.out.println(i);
System.out.println()3B
System out println();
}}
i. How many times the above statement will be executed?
ii. Write down the Big-O for the above statement?
iii. Write down the name of the growth rate.
b. Order the following functions by asymptotic growth rate - Big-O (from slower to faster):
30+10n, 9logn, 50n23n, 75n
Transcribed Image Text:a. Consider the following statements. for(int k=0; k <A, k++) { System out println(k); for(int i=0; i<A; i*=2) { System.out.println(i); System.out.println()3B System out println(); }} i. How many times the above statement will be executed? ii. Write down the Big-O for the above statement? iii. Write down the name of the growth rate. b. Order the following functions by asymptotic growth rate - Big-O (from slower to faster): 30+10n, 9logn, 50n23n, 75n
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning