What will be the worst case time complexity for the following code segment?
int count=0,N; for(i=0;i<N*2;i++){ for(j=0;j<i/3;i++){ for(k=0;k<j*j;k++){ count++; } } }
Options:
int count=0,N; --------(1)
for(i=0;i<N*2;i++){ ----->0(n)
for(j=0;j<i/3;i++){ 0(n/3)
for(k=0;k<j*j;k++){ 0((n*n)/3)
count++;
}
Answers is A
64.3k questions
77.9k answers
244k comments
80.0k users