# Time Complexity Analysis: "Cost of a Recursive Call"

When were are talking Time Complexity then as I have understood it. then to perform a while loop that will result in the cost of n(-1)/2 Further more the cost of a for loop is n(n+1)/2 - 1 but what is the cost of a recursive call?

• The time complexity of recursive calls is measured the same way as iterative procedures. However the space of a recursive call is different because each "frame" in the "call stack" will take up some memory. Dec 1, 2016 at 10:00
• @Carpetfizz yes except when you are using [terminale recursion ](en.wikipedia.org/wiki/Tail_call) Dec 1, 2016 at 13:02
• @Nulle I think you didn't understand your course. For estimating the complexity you have to count how many "unit instruction" are needed for executing the algorithm. That there is a for or while loop or a recursion in your algorithm doesn't change that you have to count how many unit instructions are executed... Dec 1, 2016 at 13:04