CSCI 51, Spring 2009
Program 8: Linked List Programming
100 points
Assigned: Thursday, April 16
Due: Friday, April 24 at 11:55 pm
This assignment has you turn in three java files, LinkedList.java, StackVector.java, and QueueVector.java
1. For the first part,
start
with LinkedList.java,
and add bubble sort,
in the same manner as selection sort and insertion
sort are already there. Therefore implement the method
public void bubbleSort()
I will test the sorting algorithms in your modified LinkedList.java in
the same way
LinkedSortingTest.java
tests selectionSort.
2. Look at Stack.java
and Queue.java,
which use a linked list object to implement the ideas of a Stack and a Queue.
Create your own classes that also act as Stack and Queue, but which use
an array as a data member
for each class. You may have an additional data member if you
think it would be useful.
Remember, a Stack is Last In First Out (LIFO), and a Queue is First In
First Out (FIFO).