COSC241

Programming and Problem Solving

Code samples from the lectures

This page contains code samples which (should) resemble those developed and used during COSC241 lectures. There will, inevitably, be some differences between what is here and what is developed `live' during a lecture.

The files are (or are meant to be) correctly packaged (typically the package name will be l01, l02 etc.) but are only minimally commented.

For the most part these are examples which should be self-explanatory and, if not, which will reward study and understanding. They generally do not represent production quality code – in particular there will tend to be no exception handling built in. They should be viewed as a foundation for exploration of the ideas that were discussed in lectures.

All mistakes are the responsibility of the author and should be assumed to be deliberate until proven otherwise :)

They come with no guarantee, either express or implied.

All that said, I hope you find them useful.

Michael Albert

Lecture Code samples
1 Circle.java, Point.java, Test.java
2 App.java, Cheater.java, Die.java, HighPlayer.java, HumanPlayer.java, LowPlayer.java, Manager.java, Player.java, RandomPlayer.java, TidyManager.java
3  
4 FacIt.java, FacRec.java, FibBasic.java, FibIt.java, FibRec.java, Hanoi.java, HelloWorldBad.java, HelloWorldGood.java
5  
6 Fib.java, GCD.java, Power.java
7 ArrayManipulation.java, SearchDemo.java, Test.java
8 ArrayManipulation.java, League.java, Team.java
9 ArrayManipulation.java, InsertionSort.java, IntSorter.java, NaiveInsertionSort.java, NearlySorted.java, SelectionSort.java, SystemSort.java, Test.java, TimingTest.java
10 Die.java, Roll.java, Selector.java, Shuffler.java, Speed.java, Test.java
11  
12 ArrayStack.java, JavaStack.java, Stack241.java, StackException.java, StackSort.java
13 ArrayStack.java, Stack241.java, StackException.java, Test.java
14 BinarySearchDemo.java, ClickWinner.java, NonsenseGenerator.java, Test.java - Data files: (Austen.txt, Kafka.txt)
15 SinglyLinkedList.java, Test.java
16 DLLTest.java, DoublyLinkedList.java
17 BankSimulation.java, CircularQ.java, EmptyQueueException.java, Queue.java, SLLQueue.java
18  
19 BinaryTree.java, LinkedBTree.java, Test.java
20 BinarySearchTree.java, LinkedBST.java, Test.java
21 ArrayHeap.java, Heap.java, Test.java
22 ArrayHeap.java, Heap.java, HeapSort.java, HeapSortTD.java, InsertionSort.java, PriorityQueue.java, ReportingHeapSort.java, SpeedTest.java
23 BA.java, ER.java, EmptyQueueException.java, Graph.java, GraphDisplay.java, GraphPanel.java, Queue.java, RGBig.java, RGTest.java, SLLQueue.java, Test.java, WS.java
24  
25 ArrayHeap.java, Edge.java, Graph.java, GridDisplay.java, GridPanel.java, Heap.java, PriorityQueue.java, RandomGridGraph.java, Test.java
Valid XHTML 1.0 Strict

Page maintained by Iain Hewson. Last modified: Mon Jun 5 14:05:36 2017