Recursion - PowerPoint PPT Presentation

Loading...

PPT – Recursion PowerPoint presentation | free to download - id: 25d593-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Recursion

Description:

Recursion. To understand recursion, you have to understand recursion... Nicolas Pelletier ... A very powerful way of resolving problems. Eliminates long and ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 9
Provided by: angel115
Learn more at: http://www.angelfire.com
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Recursion


1
Recursion
  • To understand recursion, you have to understand
    recursion
  • Nicolas Pelletier

2
Recursion calling yourself
  • A very powerful way of resolving problems
  • Eliminates long and complex solutions
  • Revolution in programming
  • Dangerous as it can go into an infinite loop
  • Can create memory leaks

3
The String reverser
This case was easy to solve, so we will use it to
demonstrate recursion
4
Here is a new way
5
How???
  • doIt(Bishops College School)
  • return l doIt(Bishops College Schoo)
  • return o doIt(Bishops College Scho)
  • return o doIt(Bishops College Sch)
  • return h doIt(Bishops College Sc)

6
Continued
7
Other example
8
Assignment 10
  • Write a recursive method in a class that solves
    the following problem
  • The method should order a list of letters (a
    string) from decreasing alphabetical order, from
    z to a
  • The list should contain 10-15 letters
About PowerShow.com