#Answer for question-01
Knowing the complexities of this period will help you determine if your code scales. Also, it is easy to compare multiple solutions to the same problem. At the end of it all, you'll be able to look at different implementations and find out which one will perform better without running the code.
#Answer for question-02
There are some bugs in the code. We need to fix it-
At first, we have to take for loop.
Then, we need to declare i.
After then, we need to put ; in the last printf() function.
Now, finding the time complexity of this code-
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)
Finally, the result will be = O(n+1) +O(n2) +O(Logn)= O(n2)
So, the time complexity is n2