• Post Reply Bookmark Topic Watch Topic
  • New Topic

Recursive Problems  RSS feed

 
Steven Alvarez
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am taking a "Programming Methods II" class and will be getting a test on recursion. He doesn't expect us to know everything. Some of the functions we worked on in class where like addition, fibonacci, factorial, and floor of log. I have no clue what will be on the test. So I was hoping you guys could give me some simple but useful problems I can then convert into a recursive method. Also if there are any links on the internet you think will be useful, please link them. Thanks for any help!!!
 
Campbell Ritchie
Marshal
Posts: 56522
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a chapter in Deitel's Java book devoted to recursion. It does start with the basics, so Fibonacci numbers and fcatorial are included. Nothing really complicated. That might be of use to you.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple simple ones ... the algorithms are much simpler than deep math problems but they might give you a bit of exercise in recursion. Reverse a string or array of letters - do recursion to the end and print on the way back out. Build all combinations of a set of letters. Solve a maze.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!