Final Review Notes
Here are some topics from the notes for the class.
Questions can come from any of these.
The final will be about the same length and complexity as
the midterm.
Probably the same kind of questions.
If you have questions, ask.
Notes 5-6
One key idea is to understand the difference between the definition
of a data structure and the implementation.
We saw several examples of each structure below using
several implementations.
Lists with pointers and lists withe array indices.
- Lists
Know about single and double linked lists.
We also saw lists with and without a header record.
Understand how to traverse (move along) the lists.
Look at the code to find the last element on the list
and how to look at every element on the list.
Know the algorithm to insert nodes between others as
well as how they are added at each end.
Notes 7
- Stacks
Stacks are LIFO structures, know what that means.
Know the operations of stacks (pop and push).
You can't see any items on the stack other than
the one on top.
Stacks can be used to reverse lists, they are used in method calls
to be able to retrace the steps.
Look at the list and array implementations.
- Queues
Queues are FIFO. Add at the end remove from the front.
Know about circular queues. We worked with the list
implementation.
Used in operating systems to controls process and disk buffers.
- Inheritance
Know how to express inheritance using the extends keyword.
The child classes have access to the methods and data of the parent.
Privates data and methods in the parent are still private to the child.
Protected things are private to the outside world and public
to the child classes.
Inheritance passes down from parent to child to grandchild and so on.
Child methods and data are not available to the parent.
Know what the 'is-a' relationship is.
Kind of as if the child had an instance of the parent inside it.
Know what composition is and how it differs from inheritance.
Know what the super reference is for.
Know what an abstract class is.
All Java objects inherit from Object.
Know what an interface is.
- Polymorphism
Many things with same name.
A variable of the type of a parent class can be used to hold
an instance of the child class.
Carefully read the instrument example.
Similar process works with interfaces.
Notes 8
More polymorphism, exceptions and I/O.
- Polymorphism
Interface hierarchies.
Know what an adapter class is.
- Exceptions
Exceptions are thrown by system errors and by user generated errors.
You can make your own exception classes.
If exceptions are not caught, usually the program crashes.
If an inner try block doesn't catch an exception,
an outer try block can catch it.
Multiple catches for a single try.
Execution stops when an exception occurs and control
transfers to the appropriate catch.
Know what the finally clause is for.
- I/O
I/O is modeled on streams.
Think of pipes of data.
Standard input is attached to the keyboard, standard out
to the screen.
Standard error usually goes to the same place as standard out.
Files are opened by constructing objects.
Carefully read the example code.
Know about the exceptions that are possible.
Notes 9
Database interfaces.
JDBC is a layer that exists between your code and the database.
You create objects to represent connections, statements and results.
Calling the methods causes the JDBC layer to access the database.
You're program doesn't have to really change to connect to
different databases.
It can do this at runtime without re-compiling.
Know the basic syntax for select and update statements.
Notes 10
Software engineering.
A development process must have at least the following stages:
requirements,design,implementation and testing.
Know the brief definitions of build and fix, waterfall
and iterative.
Know what pseudo code is.
Know what the different kinds of testing are:
unit, integration and system.
Notes 11
Recursion.
What are the rules of recursion?
Be able to write or fix a simple recursive routine.
Why would you use recursion?
Is it more or less efficient than the non-recursive one?
Is there always a non-recursive form of an algorithm?