Derive expression for the worst case time complexity for the following codes. (a) (b) (c) i=1; s=1; for(i=1;i<=n;i++) fo
Posted: Thu May 26, 2022 9:47 am
Derive expression for the worst case time complexity for the following codes. (a) (b) (c) i=1; s=1; for(i=1;i<=n;i++) for(i=n/2;i<n;i++) for(j=1;j<=i²;j++) for(j=1;j<=n/2;j++) while(s<=n) for(k=1;k<=n/2;i++) { i++; S=S+i; } for(k=1;k<=n;k*2)