If an algoritm consists of for instance two sequential calculations with a given time complexity as below, what is the total complexity for the algo?
ALGO:
calculate_one() // O(n)
calculate_two() // O(n)
Time complexity for each is O(n), is it true that the total time complexity is O(n+n) = O(n) in worst case?


LinkBack URL
About LinkBacks
