Define Recursion. Explain types and requirement of recursion ?


==> Recursion--

  • A recursive function is a function which either calls itself or is in a potential cycle of function calls.
  • As the definition specifies, there are two types of recursive functions. Consider a function which calls itself: we call this type of recursion immediate recursion and indirect recursion.
  • Ex: Factorial is immediate recursive function.

 

               void A()  {

                B();

             return;

              } 

            void B() {

              C();

            return;

            }

          void C() {

          A();

      return;

           }

 



Share to whatsapp

More Questions from Data Structures and Algorithms Module 2

Define Tower of Hanoi. Explain Problem statement for Tower of Hanoi ? 


View

 Explain Applications of Stack ? 


View

Define Circular Queue. Describe implementation of Circular Queue ? 


View

Explain about Implementation of Queue ? 


View

Define Evaluation of Postfix expression. Explain algorithm and example for it ? 


View

Define Tower of Hanoi . Explain algorithm for Tower of Hanoi ? 


View

Explain Ackermann function in details ?


View