Sample Code for Data Structures

Lecture 1:

Classes and subclasses

Rectangle.java
TestRectangle.java
LocatedRect.java
TestLR.java

Objects and references

TestObject.java

Parameter passing

TestParameters.java

Overloading

TestOverload.java
TestOverload1.java

Objects that reference other objects

Sexes.java
Person.java
TestPerson.java

Homework 1

Hwk1Ex4.java

Lecture 2. Abstract Methods and Interfaces.

Figures.java
ApplierAbs.java
TrapezoidAbs.java
ApplierInt.java
TrapezoidInt.java

Lecture 3. Recursion.

RecursiveIntFns.java
IntList.java

Lecture 4. Generics.

MyList.java
TestMyList.java
ApplierGenericAbs.java
ApplierGenericInt.java

Lecture 5. Lists. 2/11

ListAsArray.java
ListAsExpandableArray.java
MyList1.java
MyNode2.java
MyList2.java

Lectures 6 and 7. More lists

Java library list classes

LL1.java

Ordered Arrays

OrderedArray.java
TestOrderedArray.java

Ordered Lists

OrderedList.java
TestOrderedList.java

Generic Ordered Arrays

GOrderedList.java
TestGOrderedList.java

Stacks

ArrayStack.java
TestArrayStack.java

FIFO Queues: List implementation

FIFOQueue.java
TestFIFOQueue.java

FIFO Queues: Circular array implementation

CircularArray.java
TestCircularArray.java

Lecture 8

TestLibraryHash.java.
MyHashTable.java.
TestMyHashTable.java.

Lecture 9

TestEqualLists1.java
TestEqualLists2.java

Lecture 9: Trees

Tree.java
AnimalKingdom.java
BinaryTree.java
TestBinaryTree.java
ExpressionTree.java
TestExpressionTree.java

Lectures 13 and 14: Review of Linked Lists. 3/25, 3/27

Sexes.java
Person.java
MyList.java
BuildLists.java
IntList.java