Next: Texts
Up: Computer Science 172 Introduction
Previous: Who Should Take This
This course is intended to follow CSC 171, which most of you took last
semester in C++. We'll start by reviewing basic C++ syntax for a week
or so, then discuss software engineering, recursion, and some of the
principles of object-oriented programming. This should take us through
mid-October. Then we'll start looking at a variety of common data
structures, one by one: lists, stacks, queues, trees, etc.
Throughout the semester, we'll focus on the paired concepts of
algorithm and data structure.
- algorithm
- A specification of how to accomplish a particular task.
Many books use the example of a recipe in a cookbook, which specifies
how to convert raw materials (eggs, flour, etc.) into a desired end
product (a batch of cookies); other examples would be the procedure
you go through to start your car, or to multiply two large numbers
together, or the quadratic formula. Most books also define an algorithm
as a sequence of operations, but the notion of sequence is not
essential: the quadratic formula, for example, doesn't look like a
sequence of operations at first glance, and in fact it can be evaluated
in several different orders with no impact whatsoever on the result.
An algorithm is not quite the same thing as a program, although every
program has one or more algorithms at its heart.
An algorithm is more or less independent of the language in
which it is expressed: one can write essentially the same algorithm in
Java, Pascal, C++, Visual Basic, and Scheme, although they will all look
cosmetically different (with different sequences of semicolons, commas,
braces, keywords, etc).
- data structure
- A specification of how to represent a particular kind of information
in a computer. Most languages provide several ``primitive'' data
types, e.g. integers, characters, strings, functions, etc.
But if the information you need to manipulate isn't exactly one of those
kinds of information, you need to figure out how to represent it. Most
languages provide several constructs to help you build new data
structures from old ones, typically arrays, structs,
inheritance, and polymorphism.
Data structures and algorithms are usually mentioned in the same breath,
because if you come up with a wonderful data structure to hold
information, you still need to supply algorithms for accessing and
manipulating the information. Furthermore, as we'll see,
frequently the ``shape'' of a method corresponds to the ``shape'' of the
data on which it operates, so it makes sense to design a data structure
and algorithms for it simultaneously.
This principle is put into practice in the
methodology of programming called ``Object-Oriented Programming'', or OOP
for short. In an object-oriented program, not only are the data structure
and its algorithms designed simultaneously, but the program code to describe
them is tightly interwoven. You'll see what this means as the semester
goes on.
Next: Texts
Up: Computer Science 172 Introduction
Previous: Who Should Take This
2001-08-17