Next: Texts Up: Computer Science 172 Introduction Previous: Who Should Take This

Subject Matter

This course continues where CSC 171 ``Introduction to Computer Programming'' left off. We'll continue learning features of the Java language, but more importantly we'll continue studying algorithms and data structures for computational problem-solving.

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, and perhaps 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. For example, last semester we defined a class CartesianPoint to represent an ordered pair of integers, wrapped up together as a single object; and we defined a class Shish to represent an ordered list of kebabs of various sorts (lamb, tomato, etc.)

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 saw last semester, 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.

Next: Texts Up: Computer Science 172 Introduction Previous: Who Should Take This

Stephen Bloch
Mon Jan 25 14:33:12 EST 1999