Explain with an example how time complexity of an algorithm is calculated.
Answers
Answered by
2
The time complexity of algorithms is most commonly expressed using the big O notation. ... Like in the example above, for the first code the loop will run n number of times, so the time complexity will be n atleast and as the value of n will increase the time taken will also increase.
Answered by
1
Answer:
The time complexity of algorithms is most commonly expressed using the big O notation. ... Like in the example above, for the first code the loop will run n number of times, so the time complexity will be n atleast and as the value of n will increase the time taken will also increase.
i hope you like this answer
Similar questions