Q. What is direct recursion and indirect recursion?

 

Answer =

Direct recursion: - If a function calls itself directly from its functions body.

For example:

 

def a():

       a()

 

Indirect recursion: - If a function calls another function, which calls it's caller function.

For example:

def a():

       b()

def b():

       a()

 

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post