# Class 15: Recursion with Natural Numbers (2)

Back to Recursion with Natural Numbers (1). On to Recursion with Files.

This outline is also available in PDF.

Held: Tuesday, 19 September 2006

Summary: Today we begin our real exploration of numeric recursion.

Related Pages:

Assignments

Due

Notes:

• This week's extra credit: Tuesday extra (today), Convo Thursday.

Overview:

• Q & A.
• Lab.
• Reflection.

## Recursion with Numbers

• While most of the recursion we've been doing has used lists as the structure to recurse over, you can recurse with many different kinds of values.
• It is fairly common to recurse using numbers.
• The natural base cases for integers are when you hit 0 or when you hit 1.
• The natural parameter for recursive procedure calls typically involves subtracting 1 from the argument.

## Lab

Back to Recursion with Natural Numbers (1). On to Recursion with Files.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Thu Nov 30 21:43:24 2006.
The source to the document was last modified on Mon Sep 4 08:43:33 2006.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2006F/Outlines/outline.15.html`.

You may wish to validate this document's HTML ; ;

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright © 2006 Samuel A. Rebelsky. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit `http://creativecommons.org/licenses/by-nc/2.5/` or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.