CSCI 1321 (Principles of Algorithm Design II):
Sample Programs
Disclaimer: Code linked from this page is intended as a
cleaned-up and commented version of examples from class.
Many programs and classes could be further improved with
regard to functionality or design, but then they would
no longer be as close to what we did in class.
A note about source code:
Some browsers apparently do not display Java source code correctly
("flowing" it into one big paragraph).
It's not clear that this is easily fixed, but
a workaround is to use the
browser's "save" function to save it to a local file and look at
it there.
- Simple programs -- "hello world" and bank account class (8/29, 8/31):
- Bank account example again (9/12):
- Bank account example yet again (9/12 plus additions):
- Generics examples (9/14):
- String example (9/19):
- Sorting and searching examples (9/26, 9/28):
- Array-based stack, queue (10/3):
- More Java 5.0 features (10/5):
- Vector-based list with iterator (10/17):
- GUI library classes (10/26, 10/31, 11/02):
- GUI/graphics library classes (11/02, 11/07):
- Recursion (11/09):
- Binary search trees (11/16):
- I/O and networking (11/28, 12/05):
- Multithreading, etc. (11/30):
- Also see
Sample programs for parallel programming class
(Java programs are near the bottom).