CSC297.Java 2003F, Class 15: Lists, Revisited Admin: * To copy your files to MathLAN, ftp to ftp.cs.grinnell.edu * How did the histogram assignment go? * Alex thinks he did it. As does Yvonne * Sam compliments Yvonne. Yes, Sam actually complimented someone. It happens so rarely. * How did the "use previous version of the list" trick go? Overview: * Review of "use previous version" * Almost every list has a link to its cdr. * When you need the cdr, you just follow the link. * This technique is significantly faster for finding the cdr, and only marginally slower for adding something to the front. * Can we use a similar technique to make it faster to add something to the front? * Building lists with Cons cells * Think about each list as containing only two values: * The car * The cdr * To add something to the front, make a new list whose car is the new value and whose cdr is the old list. * To find the cdr, just use the old list (as we did before). * Problem: How to we build an empty list? * Solution: New class: EmptyList