Recur
- What happens, when you Google recursion?
- First : go to and read this page
- Download and run this code
- Complete these excercises in BlueJ
- Coding bat excercises
bunnyEars2() (try to figure out what goes where the question marks are)
1 2 3 4 5 6 |
if(bunnies == 0) return 0; if(bunnies % 2 == 0) return 3 +bunnyEars2(?????); return 2 +bunnyEars2( ????? ); |
Recursion problems (bunny ears is a good, straight forward one to start with)
- fibonacci()
- countHi()
- then try sumDigits()
- array6()
- array220()
- powerN()
- countHi()
- ** http://codingbat.com/prob/p195413
- ** http://codingbat.com/prob/p118182
- any of the last 6 problems
- ** print Pascal’s Triangle. Use recursion and no loops