Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(Java) Algorithm complexity (a) System.out.println(a); j = 1; while(j
(Java) Algorithm complexity
(a)
System.out.println("a");
j = 1;
while(j<=n*n*n){
for(i=1;i<= n;i *= 2){
System.out.println(i);
}
j++;
}
Time = ? (Hint: how many iteration?)
Big O notation?
(b)
for(i=1;i<= 600;i++){
for(k=1;k<= n ; k++){
System.out.println(i*k);
}
}
for(i = 1;i<= n;i++){
System.out.println(i*50);
}
Time = ?
Big O notation?
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