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

Week 2 Forum

Week 2 Forum

by Jessica Hasneen -
Number of replies: 0

Ans: 1)=    Time complexity is an algorithm signifies the total time required by the program to run till its completion.

Ans: 2)=    In this code firstly in the 3rd line we have to declare 'i',

                  Than on the 6th line we have to put for before counter,

                  Than on the 14th line we have to put in last print ("Hello"0,

For loop we can say it's = o(n+1). Than in 2nd step we see that here is 3 nested for loop so the answer id= n*n*n= 0(n^3).

On the final result we got = 0(n+1) + (n3) =0(n^3). 

So, the time complexity is n^3