0 votes 0 votes 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: O(N^4) O(N^3) O(N^2) O(N) Algorithms time-complexity algorithms asymptotic-notation + – saptarshiDey asked Jan 3, 2019 edited Jan 20, 2019 by saptarshiDey saptarshiDey 8.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 0 votes 0 votes 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++; } } } HEre we are using the for loop so that 0(n*(n/3)*(n*n)/3) so that 0(n^4) Answers is A Rackson answered Jan 20, 2019 edited Jan 22, 2019 by Rackson Rackson comment Share Follow See all 0 reply Please log in or register to add a comment.