Outline of Class 1: Introduction
Held: Monday, January 19, 1998
Administrivia
- Make sure to read the various online administrative
handouts I've prepared.
- Make sure to fill out the
introductory survey.
- Read chapter one of Bailey.
- I've just learned that the supplementary text for this course,
The Java Tutorial, won't be ready until at least March.
You should use the
online version.
- Starting next Monday at noon, and continuing most of the following weeks
will be the "CS Bag Lunch Film Festival". I strongly encourage all of
you to attend. January 26 and February 2 will be films on Java from
the creators of Java. February 9 we'll have a guest speaker from
industry who has worked for Thinking Machines, the Free Software Foundation
(GNU), the Open Software Foundation, and is currently working at a small
startup.
- CS152 is primarily a course in Data Structures and
Algorithms. At some institutions, it has that name.
- A data structure is a formalism for organizing and managing
data. Often, the way you organize the information in your program
permits or inhibits particular operations. Different structures
may also lead to different costs (in time or space).
- An algorithm expresses the steps involved in completing
a task.
- CS152 is also a course in procedural and object-oriented programming.
- Presumably, you've seen a little bit of each in CS151 (or whatever
course you've taken previously). We will certainly talk more about
both paradigms.
- We will be doing our programming in Java. However,
the language we use is less important than the concepts we learn.
- Before we delve too far into these issues, we should ground
ourselves somewhat by asking ourselves a few questions
(and I'll be asking these of the class).
- What is Computer Science?
- What is Computer Programming?
- How are they similar? How are they different?
- What is an algorithm?
- What is a computer program?
- We also want to ask ourselves some practical questions.
- What programming languages do we know?
- What CS or programming concepts are we least comfortable with?
- How comfortable are we with the workstations and Unix?
- Finally, I'd like you to reflect on the course (and you'll be doing
this again on the introductory survey).
- Why are you taking this course?
- What do you expect to get out of this class?
- A data structure is a structure designed to organize data.
You may already be familiar with two basic data structures:
the list and the vector.
- Both lists and vectors gather data into a sequence.
- More importantly, they provide facilities for manipulating the
sequence.
- You can extract an element from the sequence.
- You can change an element in the sequence.
- (Sometimes) you can insert or remove an element from the
sequence.
- Vectors and lists differ in the operations they provide and the
costs associated with each operation.
- In designing your own data structures, you will be concerned with
- The interface -- the operations the data structure
provides.
- The implementation -- how you actually provide those
operations (and how you store the data to provide those
operations).
- The efficiency of your implementation.
- The applications of the data structure.
- (Note that we want a clear barrier between interface and implementation,
so that a client of one of your data structures need only know
what you do and not how you do it.)
- This term, we will be looking at each of these aspects of a number of
the key data structures in CS.
- Computer Scientists have developed a number of strategies for looking
at algorithm and data design, including
- procedural / imperative
- object-oriented
- functional
- logical
- declarative
- While individual definitions of each category may differ, most
definitions have some similarities.
- As you might guess, object-oriented languages concern themselves with
objects.
- You might have a sense of what a "real world" object is.
- In computerese, an object is a collection of information
(sometimes called "attributes") and operations that
the object can perform (called "methods").
- We often categorize objects into classes. A class specifies
common aspects of a set of objects. These aspects are often
generic attributes and specifications of methods (E.g., "all objects in
this class have a color, a size, and can draw themselves.")
- When creating new objects, we must specify the class to
which they belong.
- Most object-oriented languages support inheritance, in which
classes can be based upon other classes. For example, we
might say that trees are a subclass of plants.
- A subclass "inherits" the attributes and methods of its
parent class.
- Many object-oriented languages are event-driven. That is,
you can specify "when this event happens, call this method
of this object."
- A key aspect of object-orientation (and good program design in any
language) is information hiding. In general, objects
should know what other objects do, but not how they
do it.
- For example, you might know that a
Menu object can
draw menus on the screen, but it's not important to you how it
does it.