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

Discussion Forum (Week 2)

Discussion Forum (Week 2)

by Mohammad Ashikuzzaman 3438 -
Number of replies: 0


                                        Answer to the question NO:-01

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.


                                              Answer to the question NO:-02


 in line 3-we have to declare i

line 6- before counter we have to add for

line 14- ; in the printf function printf (“hello”) ; would be used.

In first for loop it is = 0 (n+1)

After that in second term it is clear that here is three nested for loops, that's why the answer might be is = n*n*n = 0 (n³)

Finally result is = 0(n+1) + 0(n3) = 0 (n³)

The time complexity is n³