d the Time Complexity =  Find the Space Complexity

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

Find the Time Complexity = 

Find the Space Complexity =

Exercise 8
int loop(int N){
int ct
e, x = 1;
while(x < N){
*
x = X
2;
ct++;
}
int arr[ct];
for (int i=0; i<ct; i++) //do nothing
for (int j=0; j<ct; j++) //do nothing
return ct;
wwww
}
Transcribed Image Text:Exercise 8 int loop(int N){ int ct e, x = 1; while(x < N){ * x = X 2; ct++; } int arr[ct]; for (int i=0; i<ct; i++) //do nothing for (int j=0; j<ct; j++) //do nothing return ct; wwww }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning