CSC151, Class 50: Merge Sort
Overview:
* Questions
* Lab
* Reflection
Notes:
* Good job on presentations yesterday! It's hard to fit
stuff in ten minutes.
* Read Records in Scheme
* Questions on the exam?
Question 1: less-than
Suppose we have two vectors, a and b.
When is a less than b?
when element[0] of a is less than element[0] of b
or
when element[0] of a equals element [0] of b and
element[1] of a is less than element [1] of b
or
when elements[0..1] of a equal elements [0..1] of b and
element[2] of a is less than element [2] of b
and so on and so forth
You may find that you run out of elements in one vector before
the other. In that case, the vector that ends first is
smaller.
Can we assume that element 0 of each vector is a string
or number?
NO! Part of the fun of this problem is deep recursion
----------------------------------------
Merge sort
Do the lab.
For problem 1a, I wanted something like
(merge (list 1 2 3) (list 1 1.9 2.5) <=)
For problem 1d, your solution should look something like
(merge cs-faculty young-cs-kids
(lambda (person1 person2) ...))
(define foo (time xxx))