0 votes 0 votes for(i=0;i<=n;i++) for(j=i;j<=n;j++) for(k=j;k<=n;k++) S++; Algorithms algorithms time-complexity + – Simran Singh asked Aug 11, 2017 retagged Jun 21, 2022 by makhdoom ghaya Simran Singh 224 views answer comment Share Follow See 1 comment See all 1 1 comment reply aehkn commented Aug 12, 2017 reply Follow Share can you please re-format question correctly so that i can understand what exactly the question is 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes for i =0 ______________________ j is 0 to N so for j =0 and k is 0 to N No . of Computations will be N so for j =1 and k is 1 to N No . of Computations will be N -1 Similarly Total computations are N + N-1 + ........ + 1 = O(N2) ___________________________________________________ for i = 1 Computations are like (N-1)2 ______________________________________________ for i = 0 to N Computations are : N2 + (N-1)2 + ............ + 22+12 Overall O(N3) aehkn answered Aug 12, 2017 aehkn comment Share Follow See all 0 reply Please log in or register to add a comment.