Code&Data Insights

[ Java Programming ] Recursion 본문

Computer Science/Java Programming

[ Java Programming ] Recursion

paka_corn 2022. 4. 19. 03:21

-    Form of a recursive algorithms

 

*  Recursive Methods

-  A method that calls itself is known as a recursive method

-  Every recursive method must contain one or more

   : Base Cases, each solving the problem directly

   : Recursive Cases, each reducing the problem at hand to simpler        problems of the same type

 

-  A recursive call must

   : must progress towards the base case

   : be conditional; otherwise, it leads to infinite recursion

 

 

- A Recursive Solution

 

- An Iterative Solution

 

 

 

Comments