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

.

.

by Rayhanul Amin Nafis (201-15-3164) -
Number of replies: 0

1.Answer:

Time complexity is simply a measure of the time it takes for a function or expression to complete its task, as well as the name of the process to measure that time. It can be applied to almost any algorithm or function but is more useful for recursive functions.

Ans To The Q No 2 :-
 These are:----- 
line number 3:- we have to declare i
 line number 6:- before counter we have to also put for
 line number 14:- we have to put; in the last printf (“hello”);
In first for loop we can say it’s = 0 (n+1) Then in 2nd step, we see that here is 3 nested for loop so this answer is = n*n*n = 0 (n³) .
Final result is = 0(n+1) + 0(n3) = 0 (n³) [ lower power finish ]. The time complexity is n³.