Ana Ramirez Chang
CS 302
Assignment 1
- I would like to design an introductory computer science course. The course will be similar to 61a here at Berkeley and 15-212 at CMU, but of course only be 10 weeks long, and will use a strongly typed language, possibly OCaml or SML. The course will emphasize making use of types and datatypes when programming.
- Prerequisites: AP computer science exam, IB higherlevel computer science exam, CS3 or equivalent programming experience.
Entrance Exam: Write the pseudo code for a tree data structure and a function to traverse a tree and return the number of elements in the tree. Be sure to state any assumptions you make.
- Course Content:
- Introduction / Binding, Typing
- Scope, Evaluation
- Functional Programming, Recursion and Iteration
- Environments
- Exam
- Streams and Lazy evaluation
- Data Abstraction, mutable data
- Object-Oriented Programming
- Review
- Week reserved for time lost to holidays throughout quarter.
- This course will lay the foundation for a data structures course.
Entrance Exam:
- What is the difference between lazy and eager evaluation? Give an example of a good use of lazy evaluation.
- Write a short piece of code that demonstrates the difference between static and dynamic scoping.
- Write a function that takes a list and uses foldl to create a new list of the same length where each element is a tuple containing two copies of the original element.
For example: (1, 2, 3, 4) => ((1, 1), (2, 2), (3, 3), (4, 4))
Also give the type of the function.