CS 136 - Lecture 1

    1. Why take CS 136?
    2. Team:
    3. Sample problems:
    4. Your responsibilities:
    5. Design vs. Coding from Tomassia
    6. Java syntax for Pascal features
    7. Sample Program

Why take CS 136?

Learn about designing correct and efficient algorithms and data structures

How to implement algos and data structures in Java.

How to evaluate and visualize data structures and algos.

How to design large programs (in object-oriented way) so that it is easy to modify them.


Team:

  • Professor: Kim Bruce

  • TA's: Snehal Patel & Robin Yan
  • Course web page: http://www.cs.williams.edu/~kim/cs136/


    Sample problems:

    1. Write a backtracking algorithm to find a path from Williamstown to San Diego.

    2. Find the shortest path from Williamstown to San Diego on interstate system
      (and do it efficiently)

    3. Schedule final exams so there are no conflicts.

    4. Design and implement a scientific calculator.

    5. Design and implement a simulator that lets you study traffic flow in a city or airport.


    Your responsibilities:


    I can help present material to you to make it easier for you to learn.

    Design vs. Coding

    Data Structure and Algorithm Design goals:

    1. Correctness

    2. Efficiency

    Implementation Goals:

    1. Robustness (produces correct output for all inputs - including erroneous input)

    2. Adaptability (can evolve over time with new requirements - 2000 problem)

    3. Reusability (Use same code in multiple situations)


    Java syntax for Pascal features

    Base types: boolean, char (16 bit), int (32 bit), long (64 bit), float (32 bit), double (64 bit);

    Distinguish int and long constants by adding "L" for long - e.g. 126L

    Distinguish float and double constants by adding "f" or "F" for float - e.g., 3.1415f

    Strings: "This is a string", + used for concatenation: "This is "+"a string."

    Results of string + anything is string: "#"+17 is same as "#17"

    Briefly review syntax of "traditional" constructs: assignment, "if", "for", "while", declarations, ==, !=, etc.

    Declarations not separated from rest of code