Ana Ramirez Chang
CS 302
Assignment 1

  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.

  2. 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.

  3. Course Content:
    1. Introduction / Binding, Typing
    2. Scope, Evaluation
    3. Functional Programming, Recursion and Iteration
    4. Environments
    5. Exam
    6. Streams and Lazy evaluation
    7. Data Abstraction, mutable data
    8. Object-Oriented Programming
    9. Review
    10. Week reserved for time lost to holidays throughout quarter.

  4. This course will lay the foundation for a data structures course.

    Entrance Exam:

    1. What is the difference between lazy and eager evaluation? Give an example of a good use of lazy evaluation.
    2. Write a short piece of code that demonstrates the difference between static and dynamic scoping.
    3. 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.