Colton Idle
03/12/2021, 1:33 AMShawn
03/12/2021, 3:17 AMT(n)
for this particular algorithm”, the point of analyzing an algorithm’s time complexity is to understand how its runtime grows based on n
. Whether the actual complexity is O(n)
or O(½n)
is irrelevant; the trait you’re trying to identify in this instance is the fact that the function’s run time is linearly correlated with n
instead of, for example, exponentially or logarithmically correlated.Shawn
03/12/2021, 3:21 AMn
approaches infinity. You care about being able to identify the order of the function, rather than being able to write down exactly how long an algorithm will take to completeColton Idle
03/12/2021, 4:04 AMRob Elliot
03/12/2021, 6:53 AM