1.

Explain Recursive Functions? Also Explain The Advantages And Disadvantages Of Recursive Algorithms?

Answer»

A recursive function is a function which calls itself.
The advantages of recursive functions are:

  • A SUBSTITUTE for very complex iteration. For example, a recursive function is best to reduce the code size for Tower of HANOI application.
  • Unnecessary calling of functions can be AVOIDED.

The disadvantages of Recursive functions:

  • The exit point must be explicitly coded ,otherwise stack OVERFLOW may happen
  • A recursive function is often confusing. It is difficult to trace the logic of the function. HENCE, it is difficult to debug a recursive function.

A recursive function is a function which calls itself.
The advantages of recursive functions are:

The disadvantages of Recursive functions:



Discussion

No Comment Found