Recursive Getting Started 1

 

 

 

 Recursion is the stack, the function is recursive continue to call themselves, have export conditions if (), or else will not stop recursion stack overflow.

Note infinite loop.

 

 

 

Factorial

 

 

Print ij

 

 

Array sum

 

 

Reverse a string

 

 (Behind abcd no parentheses)

 

------------ above are: variation in repetition; ---------- repeated change

 

Fibonacci number

Earlier 纵后 Horizontal

 

 

 

 

 

Greatest common divisor

 

 

 

 

 

 

 

 

-------------- following: draw is not open, there is no recurrence formula? There is no equivalent conversion ------

Insertion sort recursive change

 

 

 

 

 

 Tower of Hanoi

 

 

 

 

 

 

 

 Position variable exchange

 

 

 

 

 

 

 

 

 

Shell sort

 

 A trip increment by increment packet, performing the insertion sort group

 

There may be repeated

 

 

 

 

The ability to exercise description into code ######

Guess you like

Origin www.cnblogs.com/lijingjaj/p/11581487.html