Discussion forum week 2(Edited)

week 2

week 2

by Muhammad Nur-A-Alam -
Number of replies: 0



Answer to the question No-02

At first we have to fix some problems of this code.
• We have to declare i in the 3rd line
• We have to use a for loop before the counter
• We will have to put a ; in line 14
In the first loop, it will be = O(n+1)
In the second loop, it will be = O(n2)
then in the third loop it will be= O(Logn)
the final result will be = O(n+1)+O(n2)+O(Logn)= O(n2)