Only in the very simple programs, of the sort you would only write when just learning to program, would what you have to do be so simple that you don't think of it except in terms of the actual programming language. In any realistic program which handles data, the question of how that data is going to be stored, and how it is to be manipulated to gain the desired outcome, is one of the main things the programmer will need to think about. A program may be technically right in the sense that it gives the right results, but so poorly designed in terms of the algorithms and data structures that it takes hours to deliver a result which could have been returned in seconds had it been better designed. 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.
Although this is not primarily a course on Java programming, Java will be the language used for it, and it is inevitable that there will be aspects of Java which you will come across first in this course. The computer science educational world is still getting to grips with the object-oriented revolution which produced the Java language, and this is reflected by conflicting claims over whether the object-oriented nature of Java is a help or a hindrance in teaching algorithms and data structures. I will be approaching data structures in an object-oriented style, which involves some updating of the "traditional" approach, though in an evolutionary rather than a revolutionary way. Because this is not a course on Java, I won't be covering the extensive set of data structures provided as part of Java's library in its collections framework, instead we will consider how to program such data structures using the building blocks of arrays and our own classes.
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 stratgey" 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.
One of the problems of the Michael Main book, so far as you are concerned, is that it assumes you have been taught an "objects first" approach to introductory programming - that is where the idea of objects and classes is one of the first thing covered in the introductory programming course. However, your introductory programming course did not take that approach, rather it was deliberately decided to leave these aspects of programming to your second programming course. Therefore, the way through the book which most closely corresponds with the order I will tackle the subjects is what Main calls the "early recursion / early sorting" route. This means starting with chapter 1, but then moving on to chapter 8 on recursion, followed by chapter 12 on sorting. As you cover more about objects and classes in your second programming course, I will move onto those data structures topics which rely on them. Chapter 2 covers the basic idea of classes, and it may be useful to read this to back up what you do in your programming course. Chapter 3 covers the idea of a collection class implemented as an Abstract Data Type, which we shall cover in detail in our course. We shall then cover topics in roughly the same order as the book.