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

Answers

Answers

by Nur Salek Ashar -
Number of replies: 0


Answer to the question no 1




Time complexity is the computational complexity that describes the amount of time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by the algorithm.It can be applied to almost any algorithm or function but is more useful for recursive functions.






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³.