What is time complexity? How to calculate Time complexity? and can we calculate time complexity for any program?
Answers
Answered by
2
Time complexity of an algorithm or a program is the order of magnitude of computation time duration required by a program to execute. The time complexity is the maximum or average time duration for execution of the program for different data sets.
The time complexity is calculated based on the number of iterations of different types, control statements and the sequential statements that we have in the program. It is taken for the longest or average data cases.
We can calculate time complexity for a program that terminates.
The time complexity is calculated based on the number of iterations of different types, control statements and the sequential statements that we have in the program. It is taken for the longest or average data cases.
We can calculate time complexity for a program that terminates.
Similar questions