What is Recursion Concepts of Recursion

Why we need recursion?
Any problem can be solved by a recursive method as well as by the iterative method. But whenever we have a problem that is complex to do just by iterative/looping method. Then we are going to divide the problem into a smaller instance of the same problem that means we solve it by the recursive method.


What is call Stack?
A call stack is a stack data structure that is used to trace the sequence of the function call. When a function called then it’s get pushed inside the stack and when a function returns it popped out from the stack.

Three Concepts of Recursion
Base Case (Terminating Case)
Small Problem
Processing Logic
Types of Recursion:
Tail Recursion:

If a recursive function is calling itself and that recursive call is the last statement in the function. After that call there is nothing, it is not performing anything.

Head Recursion:

If a recursive function is calling itself and that recursive call is the first statement in the function and some operations are performed after the call. The function doesn’t have a processor to perform any operation at the time of calling. It has to do everything at the time of returning.

Linear Recursion:

A linear recursive function is a function that only makes a single call to itself each time the function runs. It has something to process before and after the call.

Read Full Article Here – https://brain-mentors.com/what-is-recursion/

  • Issue by:Brain Mentors Pvt. Ltd.
  • Web:https://brain-mentors.com/what-is-recursion/
  • Street:H.No.-23, Ist & IInd floor, Blk- C, Pkt-9, opp. to Metro Pillar Number 400, , above 24 Seven, Sector 7, Rohini, Delhi, 110085
  • City:Delhi
  • State/province:Delhi
  • Country/region:India
  • Zip:110086
  • About Viv-Media|Free Add URL|Submit Press Release|Submit How To|SiteMap|Advertise with Us|Help|Contact Viv-Media |China Viv-Media
  • Copyright© 2010-2020 viv-media.com Corporation.
    Use of this web constitutes acceptance of Terms of Service and Privacy Policy. All rights reserved.  Poetry Online :Ancient Chinese Poetry