Tuesday, 3 December 2019

Recursive Function

Iterative function
Recursive function
A function calls some other function
A function calls itself
For,while can be used
If condition is necessary
One function call is enough to get the result
Several function calls are involved to get the result
Fast in execution since one function call is enough
Slow in execution since since several function calls are involved (as no of function calls increased execution will slow down
Function call leads to value
One function call leads to one more function call
Easy to write
Difficult to write
No stacks are used
Os uses stacks during the execution

Related Video: https://youtu.be/VWgE2KbKF7I

Prev: Global variables and Local variables
Next:Tower of Hanoi

No comments:

Post a Comment

Files with Exception handling

#Ask the user to take two input integer values var a,b try:     a=int(input("enter any integer value:"))     b=int(input(&qu...