You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not the time taken by the code to run because this time is dependent on the system.Eg: Windows might take more time to run a code as compared to Mac.
It is the rate at which the time taken increases with respect to the input size.(theta graph)
Three steps:
1.Always compute time complexity in terms of worst case scenario.(Best, Average, Worst)
2.Avoid constants.
3.Avoid lower values.
SPACE COMPLEXITY:
It is the memory space that a program takes.
Auxiliary space(space that you take to solve the problem)+Input space(Space that you take to store the input).
Generally , most of the servers(leetcode,GFG, etc) takes 1 second for 10^8 operations. 2 seconds for 2*10^8 opeartions.