Algorithms and Data Structures: Aims and Objectives

The role of algorithms and data structures in Computer Science

Programming forms the core of Computer Science. Algorithms and data structures move the focus of programming away from the constructs found in programming languages to considering how we can program the computer to do useful things. You will find a course in algorithms and data structures comes early on in most computer science curricula, generally following on from the introductory programming course. An algorithm is a way of doing something - a set of instructions which if obeyed gives the desired result. But the instructions aren't specified in a programming language, rather they are specified in more general terms, and the programmer must find ways of translating the general idea given as an algorithm into the more specific instructions of whichever programming language he or she is using. Data structures are ways of storing data in computers so we can make best use of it. Again, these ways will be expressed in general terms and programmers have to fill in the details for whatever programming language they are using. Algorithms and data structures go together because most algorithms work on manipulating collections of data.

Computer scientists over the years have thought long and hard about the main sort of problems that are likely to be encountered in building programs, and designed suitable algorithms and data structures which are efficient and which are proven to do the job correctly. This course will start you off becoming aware of these issues. In modern programming languages, such as Java, code to implement common algorithms and data structures is often provided for you as part of the code library which comes with the language implementation. This means that the programmer's task moves from directly implementing the algorithms and data structures to picking out the most appropriate ones for the use in mind. However, in more complex programming tasks, it is still necessary to invent and implement one's own algorithms and data structures.

Aims

The aim of this course is to give you a feel for algorithms and data structures as a central part of what it is to be a computer scientist. You should end it appreciating that understanding the algorithm and data structures used for some problem is much more important than knowing the exact code for it in some programming language. You should be aware of the fact that there are often several algorithms for some problem, and one algorithm may be better than another, or one algorithm better in some circumstances and another better in others. You should have some idea of how to work out the efficiency of an algorithm, though we won't cover detailed formal analysis. You should be confident with algorithms expressed using both iteration and recursion, and have some idea of how to convert algorithms expressed using recursion into iteration. You will be able to use and design linked data structures, but appreciate why it is good programming style to hide the details of a data structure within an abstract data type. You will appreciate how the inheritance mechanism of object-oriented languages enables you to write generalised code expressing an algorithm or data structure in a way that may be used in a variety of real-world situations.

Objectives

Some of the topics covered will be similar to those found in introductory algorithms and data structures courses in computer science departments across the world: sorting and searching algorithms, categorising efficiency in time and memory use, linked list and array structures. There will also be general material on object-oriented programming, an introduction to the idea of using code libraries provided with modern programming languages, and an introduction to the idea of generic types. The objectives are that you should know something of all of these by the end of the course. As well as knowing about them, you should be familiar enough with the concepts that should you need to take any of them further and make use of them, you will be able to do so.

The course will be taught using the latest version of Java, J2SE 5.0, and a subsidiary objective of the course will be to introduce you to some additional features of this language which are not covered in your other programming courses.

The course will not assume the existence of any specialised development environment, or any input/output code beyond that provided as part of the Java standard library. You may find this "plain" approach an interesting and useful contrast with the use of the BlueJ Java interactive development environment in the Object-Oriented Programming course you are taking alongside this course.

How to pass this course

I made some notes on "how to pass the course" when I taught the introductory programming course at Queen Mary, and what I wrote then is mostly relevant to this course as well.

The main thing is to be aware that learning is an active thing, not a passive thing, particularly in university education, and particularly in a subject like computer science. If your attitude is that you don't have to do very much yourself, and it is the job of academic staff to "fill you up" with knowledge, you won't get far. Academic staff can point you in the right direction, give you an indication of the things it is most profitable to study, set you exercises and assess you in them, but it's up to you to do the actual studying. You should not confuse learning with memorising. If at any point in this course you find yourself trying to memorise things, you have completely the wrong approach. If "last minute revision" forms a major part of your exam-passing strategy, then you need to rethink that strategy. In fact, you shouldn't be thinking in terms of "exam-passing strategy" at all - you should be thinking in terms of understanding and appreciating an important aspect of a subject you are doing because you enjoy it. Then passing the exam will come naturally as a by-product.

The best way to learn is by doing. Try to understand the algorithms and data structures, and then program them yourself in your own style. Please remember that being a university student is meant to be a full-time job, The fact that your scheduled lecture and lab hours do not make up a full working week means you should be devising your own schedule of extra work to make up the full 35-40 hours a week a paid employee would consider to be the norm.

I have produced some notes of my own which explain my own view of the topics of this course, and my own attempts to write programs that demonstrate them. But you will also find it useful to see how others explain the same topics, and program them. This will help you understand that it's the principles that are important, not the exact form of the program. It would be useful for you to own and work through at least one of the recommended textbooks. I have also put together a comprehensive site of algorithms and data structures links specialising in particular on course notes provided in public web space for similar academic courses in universities across the world. Please make use of all these resources.

The lectures should be regarded as the "pacemaker" of the course. They will give you an idea of the speed at which the topics in the course should be covered, and the relative importance of the different topics. "Chalk and talk" sessions which show how structures change as an algorithm is executed are an important part of the course. So please do not make the mistake of either feeling you don't need to attend lectures (because I have made a full set of notes available in advance) or that all you need to do is attend the lectures.

Lab exercises will be set weekly exploring and testing some of the material covered in class. The best way to learn this material is by having practical experience with it. Lab exercises will be a mixture of problems similar to those you will encounter in tests and exams for the course, and more challenging examples which will take some time to think through and program. Although you are allocated a one hour slot a week, this is not meant to be the only time you spend on the lab exercises, you should expect to be spending several more hours a week outside the set lab hour on them if you are to tackle this course in the way intended.

Book

There is a recommended book for this course, Data Structures with Java by William H. Ford and William R. Topp. There are actually many books on algorithms and data structures using Java to program the examples. This one, like most of the others, covers far more material than we can cover in a one semester course. Approximately the first half of the material in this book is directly relevant for this course, the rest is good extra material, but it would only be taught if there were a second more advanced course on algorithms and data structures.
Matthew Huntbach
Last modified: 3 March 2006