Bifalgorithm post · Computer science one · Recursion
What happens when a function calls itself?
What happens when a function calls itself? (Computer science one · Recursion) — "The function in this case is called CountDown (). In Line 5 the function calls…
Ideas in this flowchart
- Recursion occurs when a function calls itself
- The function in this case is called CountDown()
- In Line 5, CountDown() calls itself with a decremented value
- A function that calls itself is called a recursive function
- A language supports recursion when it allows functions to call themselves
- Functions commonly invoke other functions
- Each function call creates a new stack frame on the program stack
- A function calling itself is not fundamentally different from calling another function