University of California, Berkeley
EECS Department - Computer Science Division
CS3 Lecture 26 : Let's take a Final Together!
Guest Lecturer: Lisa Nguyen
Overview of today's lecture
Review
Last time
- Anjna Mehta showed us Box and Pointers
Let's take a final together!
Overview -- I.e., what are the main
topics?
- All the material from Midterm 1, 2 and 3
- Abstraction
- Data abstractions, violations, selectors & constructors
- Lists
- Basics (cons, list, append, car, cdr, cdadar, etc.)
- Normal recursion but with lists instead of sentences
- Deep recursion which goes all the way down the list structure
- Implementing Higher-Order Functions
- Trees
- Designing functions to traverse a tree and do things (calculate,
test, map, etc.)
- Given a number, build a tree from scratch
- Input / Output
- Basics (begin, display, read, write)
- How side-effects differ from return values
- Fractals
- Given fractal code, draw the first few generations
- Fill in the missing lines in fractal code given a description
of a fractal
- Seeing patterns and making inferences
- Recursion Potpourri
- Advanced recursion in many different contexts
- Guest lecture topics
- From guest lecture #1
- From guest lecture #2
- Final projects
Summary
- Study hard, but don't panic for the final.
Next Time
- We'll have a summary of the course and let you know of places
you can go next.
Puzzle : Sharing a Bottle [Puzzlegrams
by Pentagram, Fireside Publishing, 1989]
- Two tramps are sharing a bottle of wine.
- They want to be sure that each one of them drinks exactly
half the available wine but they have no glasses, or any other
container, or anything else with which to mark the bottle.
- The bottle is an irregular convex shape (it's hand-blown).
- Can it be done?
Game : Maharajah and the Sepoys [Pentagames
by Pentagram, Fireside Publishing, 1990]
- One player takes the white Chess pieces and arranges them
as shown above.
- These are the "Sepoys".
- The other player a single black Knight as the "Maharajah"
and places it on any other square (the diagram above is
just one possible example).
- All the pieces move as in Chess, but the Maharajah only has
the moves of the Knight and the Queen.
- The object of the game is for the first player to checkmate
the Maharajah while he tries to checkmate the King.