Fundamentals of CS I (CS151 2002F)
Primary:
[Skip To Body]
[Front Door]
[Current]
[Glance]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Miscellaenous:
[Scheme Reference]
[CS151 2002F Gum]
[CS151 2001S]
[SamR]
[Glimmer Labs]
[schemers.org]
Back to Repetition with Recursion. On to More Recursion with Lists.
Held Tuesday, September 24, 2002
Summary
Today we investigate recursion over lists with a number of experiments.
Assignments
Notes:
Overview
patternone uses to design certain kinds of procedures.
(define proc
(lambda (val)
(if (base-case-test)
(base-case val)
(combine (partof val)
(proc (update val))))))
(define proc
(lambda (lst)
(if (null? lst)
null-case
(combine (onestep (car val))
(proc (cdr val))))))
if. For example, here's
one implementation of member that works on the principle that
.valis a member oflstif the list is not empty andvalis the first element oflstorvalis a member of the remainder oflst
(define member?
(lambda (val lst)
(and (not (null? lst))
(or (equal? val (car lst))
(member? val (cdr lst))))))
Thursday, 29 August 2002 [Samuel A. Rebelsky]
Tuesday, 24 September 2002 [Samuel A. Rebelsky]
Back to Repetition with Recursion. On to More Recursion with Lists.
Primary:
[Skip To Body]
[Front Door]
[Current]
[Glance]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Miscellaenous:
[Scheme Reference]
[CS151 2002F Gum]
[CS151 2001S]
[SamR]
[Glimmer Labs]
[schemers.org]
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 Mon Dec 2 08:41:06 2002.
The source to the document was last modified on Tue Sep 24 09:07:19 2002.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2002F/Outlines/outline.15.html.
You may wish to
validate this document's HTML
;
;
Check with Bobby