Page 1 of 1
What is the time complexity of the following code (Suppose m>0 and n>1)? int func (int m, int n) { int i=0; while (m<100
Posted: Fri Jun 10, 2022 11:58 am
by correctanswer

- What Is The Time Complexity Of The Following Code Suppose M 0 And N 1 Int Func Int M Int N Int I 0 While M 100 1 (17.3 KiB) Viewed 70 times

- What Is The Time Complexity Of The Following Code Suppose M 0 And N 1 Int Func Int M Int N Int I 0 While M 100 2 (4.14 KiB) Viewed 70 times
What is the time complexity of the following code (Suppose m>0 and n>1)? int func (int m, int n) { int i=0; while (m<100) { i++; m++; } for (int i=0; i<n-1; i++) { for (int j-n; j>i; j--) return i*j; }
A. 0(m) B. 0(²) C. 0(m+n²) D. 0(1)