To operate the Blended Learning Center(BLC) at optimal level, maintenance will be performed every day at 8:30 AM and at 5:00 PM regularly which can take up to 30 minutes. Please consider scheduling your activity in the BLC platform accordingly.
Discussion forum week 2(Edited)
an
Answer to the question no 1
The time complexity of an algorithm is the total amount of time required by an algorithm to complete its execution. The time taken by any piece of code to run is known as the time complexity of that code. The lesser the time complexity, the faster the execution.
Answer to the question no 2
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)