Discussion Forum on time complexity, self referential structure (Week 2)

Time complexity

Time complexity

by Md Taufiq ali -
Number of replies: 0

Time complexity :



In computer science, time complexity is the complexity of computation that describes the time it takes to run an algorithm. Time complexity is usually estimated by calculating the initial activities performed by the algorithm, assuming that each initial activity takes a certain amount of time to perform. Thus, the initial activity performed by time and algorithm is separated by the most constant factor.


(Answer to the question no 2)

In line number 3- we need to announce i.


In line number 6:- preceding counter we need to likewise put for.  


In line number  14:- we need to put ; in last printf ("hello"); 


In first for circle we can say it's = 0 (n+1). At that point in second step we see that here is 3 settled for circle so this answer is = n*n*n=  0 (n³) .Conclusive outcome is = 0(n+1) + 0(n3) = 0 (n³) [ lower power finish ]. 


The time complexity  is n³.