Computer Science Fundamentals (CS153 2003S)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Experiments in Java]
[Scheme Reference]
[Scheme Report]
[CS153 2002S (Walker)]
[CS151 2003S (Rebelsky)]
[CS152 2000F (Rebelsky)]
[SamR]
Back to Arrays. On to Designing Objects.
Held: Monday, 7 April 2003
Summary: Today we go over some of the key issues from exam 2.
Related Pages:
Assignments:
Notes:
Overview:
binary-search: use indices to keep track of
the lower and upper bounds of the parts.
split into two partspart.
define partition!
(let ((swap! (lambda (vec i j)
(let ((tmp (vector-ref vec i)))
(vector-set! vec i (vector-ref vec j))
(vector-set! vec j tmp)))))
(lambda (vec lower upper can-come-before?)
(if (= lower upper)
lower
(begin
(let kernel! ((l lower)
(u upper))
(cond
((= u l)
(begin
(swap! vec lower u)
u))
((not (can-come-before? (vector-ref vec u)
(vector-ref vec lower)))
(kernel! l (- u 1)))
((can-come-before? (vector-ref vec l)
(vector-ref vec lower))
(kernel! (+ l 1) u))
(else (begin
(swap! vec l u)
(kernel! l u))))))))))
Thursday, 15 January 2003 [Samuel A. Rebelsky]
Sunday, 6 April 2003 [Samuel A. Rebelsky]
Back to Arrays. On to Designing Objects.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Experiments in Java]
[Scheme Reference]
[Scheme Report]
[CS153 2002S (Walker)]
[CS151 2003S (Rebelsky)]
[CS152 2000F (Rebelsky)]
[SamR]
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 Tue May 6 09:20:55 2003.
The source to the document was last modified on Sun Apr 6 23:20:49 2003.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS153/2003S/Outlines/outline.37.html.
You may wish to
validate this document's HTML
;
;
Check with Bobby