diff --git a/DataStructures/AATree.html b/DataStructures/AATree.html new file mode 100644 index 0000000..bdc121c --- /dev/null +++ b/DataStructures/AATree.html @@ -0,0 +1,353 @@ + + + +
+ +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.AATree ++
+Implements an AA-tree. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
AATree()
+
++ Construct the tree. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the tree. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the tree. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public AATree()+
+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.AvlTree ++
+Implements an AVL tree. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
AvlTree()
+
++ Construct the tree. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the tree. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the tree; duplicates are ignored. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public AvlTree()+
+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.BinaryHeap ++
+Implements a binary heap. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
BinaryHeap()
+
++ Construct the binary heap. |
+|
BinaryHeap(int capacity)
+
++ Construct the binary heap. |
+
+Method Summary | +|
+ Comparable |
+deleteMin()
+
++ Remove the smallest item from the priority queue. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the priority queue. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the priority queue, maintaining heap order. |
+
+ boolean |
+isEmpty()
+
++ Test if the priority queue is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the priority queue is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the priority queue logically empty. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public BinaryHeap()+
+public BinaryHeap(int capacity)+
capacity
- the capacity of the binary heap.+Method Detail | +
+public void insert(Comparable x) + throws Overflow+
x
- the item to insert.Overflow
- if container is full.+public Comparable findMin()+
+public Comparable deleteMin()+
+public boolean isEmpty()+
+public boolean isFull()+
+public void makeEmpty()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.BinarySearchTree ++
+Implements an unbalanced binary search tree. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
BinarySearchTree()
+
++ Construct the tree. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the tree. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the tree; duplicates are ignored. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public BinarySearchTree()+
+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.BinomialQueue ++
+Implements a binomial queue. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
BinomialQueue()
+
++ Construct the binomial queue. |
+
+Method Summary | +|
+ Comparable |
+deleteMin()
+
++ Remove the smallest item from the priority queue. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the priority queue. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the priority queue, maintaining heap order. |
+
+ boolean |
+isEmpty()
+
++ Test if the priority queue is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the priority queue is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the priority queue logically empty. |
+
+ void |
+merge(BinomialQueue rhs)
+
++ Merge rhs into the priority queue. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public BinomialQueue()+
+Method Detail | +
+public void merge(BinomialQueue rhs) + throws Overflow+
rhs
- the other binomial queue.Overflow
- if result exceeds capacity.+public void insert(Comparable x) + throws Overflow+
x
- the item to insert.Overflow
- if capacity exceeded.+public Comparable findMin()+
+public Comparable deleteMin()+
+public boolean isEmpty()+
+public boolean isFull()+
+public void makeEmpty()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+Protocol for Comparable objects. + In Java 1.2, you can remove this file. +
+
+Method Summary | +|
+ int |
+compareTo(Comparable rhs)
+
++ Compare this object with rhs. |
+
+Method Detail | +
+public int compareTo(Comparable rhs)+
rhs
- the second Comparable.
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.CursorList ++
+Linked list implementation of the list + using a header node; cursor version. + Access to the list is via CursorListItr. +
+
CursorListItr
+Constructor Summary | +|
CursorList()
+
++ Construct the list. |
+
+Method Summary | +|
+ CursorListItr |
+find(java.lang.Object x)
+
++ Return iterator corresponding to the first node containing an item. |
+
+ CursorListItr |
+findPrevious(java.lang.Object x)
+
++ Return iterator prior to the first node containing an item. |
+
+ CursorListItr |
+first()
+
++ Return an iterator representing the first node in the list. |
+
+ void |
+insert(java.lang.Object x,
+ CursorListItr p)
+
++ Insert after p. |
+
+ boolean |
+isEmpty()
+
++ Test if the list is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the list logically empty. |
+
+static void |
+printList(CursorList theList)
+
++ |
+
+ void |
+remove(java.lang.Object x)
+
++ Remove the first occurrence of an item. |
+
+ CursorListItr |
+zeroth()
+
++ Return an iterator representing the header node. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public CursorList()+
+Method Detail | +
+public boolean isEmpty()+
+public void makeEmpty()+
+public CursorListItr zeroth()+
+public CursorListItr first()+
+public void insert(java.lang.Object x, + CursorListItr p)+
x
- the item to insert.p
- the position prior to the newly inserted item.+public CursorListItr find(java.lang.Object x)+
x
- the item to search for.+public CursorListItr findPrevious(java.lang.Object x)+
x
- the item to search for.+public void remove(java.lang.Object x)+
x
- the item to remove.+public static void printList(CursorList theList)+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.CursorListItr ++
+Linked list implementation of the list iterator + using a header node; cursor version. +
+
CursorList
+Method Summary | +|
+ void |
+advance()
+
++ Advance the current position to the next node in the list. |
+
+ boolean |
+isPastEnd()
+
++ Test if the current position is past the end of the list. |
+
+ java.lang.Object |
+retrieve()
+
++ Return the item stored in the current position. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Method Detail | +
+public boolean isPastEnd()+
+public java.lang.Object retrieve()+
+public void advance()+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.DSL ++
+Implements a deterministic skip list. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
DSL(Comparable inf)
+
++ Construct the DSL. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the DSL. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the DSL. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the DSL. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the DSL. |
+
+ boolean |
+isEmpty()
+
++ Test if the DSL is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the DSL logically empty. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the DSL. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public DSL(Comparable inf)+
inf
- the largest Comparable.+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.DisjSetsFast ++
+Disjoint set class, using union by rank + and path compression. + Elements in the set are numbered starting at 0. +
+
+Constructor Summary | +|
DisjSetsFast(int numElements)
+
++ Construct the disjoint sets object. |
+
+Method Summary | +|
+ int |
+find(int x)
+
++ Perform a find with path compression. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+union(int root1,
+ int root2)
+
++ Union two disjoint sets using the height heuristic. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public DisjSetsFast(int numElements)+
numElements
- the initial number of disjoint sets.+Method Detail | +
+public void union(int root1, + int root2)+
root1
- the root of set 1.root2
- the root of set 2.+public int find(int x)+
x
- the element being searched for.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+Protocol for Hashable objects. +
+
+Method Summary | +|
+ int |
+hash(int tableSize)
+
++ Compute a hash function for this object. |
+
+Method Detail | +
+public int hash(int tableSize)+
tableSize
- the hash table size.
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.LeftistHeap ++
+Implements a leftist heap. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
LeftistHeap()
+
++ Construct the leftist heap. |
+
+Method Summary | +|
+ Comparable |
+deleteMin()
+
++ Remove the smallest item from the priority queue. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the priority queue. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the priority queue, maintaining heap order. |
+
+ boolean |
+isEmpty()
+
++ Test if the priority queue is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the priority queue is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the priority queue logically empty. |
+
+ void |
+merge(LeftistHeap rhs)
+
++ Merge rhs into the priority queue. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public LeftistHeap()+
+Method Detail | +
+public void merge(LeftistHeap rhs)+
rhs
- the other leftist heap.+public void insert(Comparable x)+
x
- the item to insert.+public Comparable findMin()+
+public Comparable deleteMin()+
+public boolean isEmpty()+
+public boolean isFull()+
+public void makeEmpty()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.LinkedList ++
+Linked list implementation of the list + using a header node. + Access to the list is via LinkedListItr. +
+
LinkedListItr
+Constructor Summary | +|
LinkedList()
+
++ Construct the list |
+
+Method Summary | +|
+ LinkedListItr |
+find(java.lang.Object x)
+
++ Return iterator corresponding to the first node containing an item. |
+
+ LinkedListItr |
+findPrevious(java.lang.Object x)
+
++ Return iterator prior to the first node containing an item. |
+
+ LinkedListItr |
+first()
+
++ Return an iterator representing the first node in the list. |
+
+ void |
+insert(java.lang.Object x,
+ LinkedListItr p)
+
++ Insert after p. |
+
+ boolean |
+isEmpty()
+
++ Test if the list is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the list logically empty. |
+
+static void |
+printList(LinkedList theList)
+
++ |
+
+ void |
+remove(java.lang.Object x)
+
++ Remove the first occurrence of an item. |
+
+ LinkedListItr |
+zeroth()
+
++ Return an iterator representing the header node. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public LinkedList()+
+Method Detail | +
+public boolean isEmpty()+
+public void makeEmpty()+
+public LinkedListItr zeroth()+
+public LinkedListItr first()+
+public void insert(java.lang.Object x, + LinkedListItr p)+
x
- the item to insert.p
- the position prior to the newly inserted item.+public LinkedListItr find(java.lang.Object x)+
x
- the item to search for.+public LinkedListItr findPrevious(java.lang.Object x)+
x
- the item to search for.+public void remove(java.lang.Object x)+
x
- the item to remove.+public static void printList(LinkedList theList)+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.LinkedListItr ++
+Linked list implementation of the list iterator + using a header node. +
+
LinkedList
+Method Summary | +|
+ void |
+advance()
+
++ Advance the current position to the next node in the list. |
+
+ boolean |
+isPastEnd()
+
++ Test if the current position is past the end of the list. |
+
+ java.lang.Object |
+retrieve()
+
++ Return the item stored in the current position. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Method Detail | +
+public boolean isPastEnd()+
+public java.lang.Object retrieve()+
+public void advance()+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.MyInteger ++
+Wrapper class for use with generic data structures. + Mimics Integer. + In Java 1.2, you can use Integer if Comparable is needed. +
+
+Constructor Summary | +|
MyInteger()
+
++ Construct the MyInteger object with initial value 0. |
+|
MyInteger(int x)
+
++ Construct the MyInteger object. |
+
+Method Summary | +|
+ int |
+compareTo(Comparable rhs)
+
++ Implements the compareTo method. |
+
+ boolean |
+equals(java.lang.Object rhs)
+
++ Implements the equals method. |
+
+ int |
+hash(int tableSize)
+
++ Implements the hash method. |
+
+ int |
+intValue()
+
++ Gets the stored int value. |
+
+ java.lang.String |
+toString()
+
++ Implements the toString method. |
+
Methods inherited from class java.lang.Object | +
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
+Constructor Detail | +
+public MyInteger()+
+public MyInteger(int x)+
x
- the initial value.+Method Detail | +
+public int intValue()+
+public java.lang.String toString()+
toString
in class java.lang.Object
+public int compareTo(Comparable rhs)+
compareTo
in interface Comparable
rhs
- the other MyInteger object.ClassCastException
- if rhs is not
+ a MyInteger.+public boolean equals(java.lang.Object rhs)+
equals
in class java.lang.Object
rhs
- the second MyInteger.ClassCastException
- if rhs is not
+ a MyInteger.+public int hash(int tableSize)+
hash
in interface Hashable
tableSize
- the hash table size.
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--java.lang.Throwable + | + +--java.lang.Exception + | + +--DataStructures.Overflow ++
+Exception class for access in full containers + such as stacks, queues, and priority queues. +
+
+Constructor Summary | +|
Overflow()
+
++ |
+
Methods inherited from class java.lang.Throwable | +
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
+Constructor Detail | +
+public Overflow()+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.PairHeap ++
+Implements a pairing heap. + Supports a decreaseKey operation. + Note that all "matching" is based on the compareTo method. +
+
PairNode
+Constructor Summary | +|
PairHeap()
+
++ Construct the pairing heap. |
+
+Method Summary | +|
+ void |
+decreaseKey(PairNode p,
+ Comparable newVal)
+
++ Change the value of the item stored in the pairing heap. |
+
+ Comparable |
+deleteMin()
+
++ Remove the smallest item from the priority queue. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the priority queue. |
+
+ PairNode |
+insert(Comparable x)
+
++ Insert into the priority queue, and return a PairNode + that can be used by decreaseKey. |
+
+ boolean |
+isEmpty()
+
++ Test if the priority queue is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the priority queue logically empty. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public PairHeap()+
+Method Detail | +
+public PairNode insert(Comparable x)+
x
- the item to insert.+public Comparable findMin()+
+public Comparable deleteMin()+
+public void decreaseKey(PairNode p, + Comparable newVal)+
p
- any node returned by addItem.newVal
- the new value, which must be smaller
+ than the currently stored value.+public boolean isEmpty()+
+public void makeEmpty()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.PairNode ++
+Public class for use with PairHeap. It is public + only to allow references to be sent to decreaseKey. + It has no public methods or members. +
+
PairHeap
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+ + + + + + + + + + +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.QuadraticProbingHashTable ++
+Probing table implementation of hash tables. + Note that all "matching" is based on the equals method. +
+
+Constructor Summary | +|
QuadraticProbingHashTable()
+
++ Construct the hash table. |
+|
QuadraticProbingHashTable(int size)
+
++ Construct the hash table. |
+
+Method Summary | +|
+ Hashable |
+find(Hashable x)
+
++ Find an item in the hash table. |
+
+static int |
+hash(java.lang.String key,
+ int tableSize)
+
++ A hash routine for String objects. |
+
+ void |
+insert(Hashable x)
+
++ Insert into the hash table. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the hash table logically empty. |
+
+ void |
+remove(Hashable x)
+
++ Remove from the hash table. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public QuadraticProbingHashTable()+
+public QuadraticProbingHashTable(int size)+
size
- the approximate initial size.+Method Detail | +
+public void insert(Hashable x)+
x
- the item to insert.+public void remove(Hashable x)+
x
- the item to remove.+public Hashable find(Hashable x)+
x
- the item to search for.+public void makeEmpty()+
+public static int hash(java.lang.String key, + int tableSize)+
key
- the String to hash.tableSize
- the size of the hash table.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.QueueAr ++
+Array-based implementation of the queue. +
+
+Constructor Summary | +|
QueueAr()
+
++ Construct the queue. |
+|
QueueAr(int capacity)
+
++ Construct the queue. |
+
+Method Summary | +|
+ java.lang.Object |
+dequeue()
+
++ Return and remove the least recently inserted item from the queue. |
+
+ void |
+enqueue(java.lang.Object x)
+
++ Insert a new item into the queue. |
+
+ java.lang.Object |
+getFront()
+
++ Get the least recently inserted item in the queue. |
+
+ boolean |
+isEmpty()
+
++ Test if the queue is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the queue is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the queue logically empty. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public QueueAr()+
+public QueueAr(int capacity)+
+Method Detail | +
+public boolean isEmpty()+
+public boolean isFull()+
+public void makeEmpty()+
+public java.lang.Object getFront()+
+public java.lang.Object dequeue()+
+public void enqueue(java.lang.Object x) + throws Overflow+
x
- the item to insert.Overflow
- if queue is full.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.Random ++
+Random number class, using a 31-bit + linear congruential generator. + Note that java.util contains a class Random, + so watch out for name conflicts. +
+
+Constructor Summary | +|
Random()
+
++ Construct this Random object with + initial state obtained from system clock. |
+|
Random(int initialValue)
+
++ Construct this Random object with + specified initial state. |
+
+Method Summary | +|
+static void |
+main(java.lang.String[] args)
+
++ |
+
+static void |
+permute(java.lang.Object[] a)
+
++ Randomly rearrange an array. |
+
+ double |
+random0_1()
+
++ Return a pseudorandom double in the open range 0..1 + and change the internal state. |
+
+ int |
+randomInt()
+
++ Return a pseudorandom int, and change the + internal state. |
+
+ int |
+randomInt(int low,
+ int high)
+
++ Return an int in the closed range [low,high], and + change the internal state. |
+
+ int |
+randomIntWRONG()
+
++ Return a pseudorandom int, and change the + internal state. |
+
+ long |
+randomLong(long low,
+ long high)
+
++ Return an long in the closed range [low,high], and + change the internal state. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public Random()+
+public Random(int initialValue)+
initialValue
- the initial state.+Method Detail | +
+public int randomInt()+
+public int randomIntWRONG()+
+public double random0_1()+
+public int randomInt(int low, + int high)+
low
- the minimum value returned.high
- the maximum value returned.+public long randomLong(long low, + long high)+
low
- the minimum value returned.high
- the maximum value returned.+public static final void permute(java.lang.Object[] a)+
a
- the array.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.RedBlackTree ++
+Implements a red-black tree. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
RedBlackTree(Comparable negInf)
+
++ Construct the tree. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item the tree. |
+
+ void |
+insert(Comparable item)
+
++ Insert into the tree. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public RedBlackTree(Comparable negInf)+
negInf
- a value less than or equal to all others.+Method Detail | +
+public void insert(Comparable item)+
item
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.SeparateChainingHashTable ++
+Separate chaining table implementation of hash tables. + Note that all "matching" is based on the equals method. +
+
+Constructor Summary | +|
SeparateChainingHashTable()
+
++ Construct the hash table. |
+|
SeparateChainingHashTable(int size)
+
++ Construct the hash table. |
+
+Method Summary | +|
+ Hashable |
+find(Hashable x)
+
++ Find an item in the hash table. |
+
+static int |
+hash(java.lang.String key,
+ int tableSize)
+
++ A hash routine for String objects. |
+
+ void |
+insert(Hashable x)
+
++ Insert into the hash table. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the hash table logically empty. |
+
+ void |
+remove(Hashable x)
+
++ Remove from the hash table. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public SeparateChainingHashTable()+
+public SeparateChainingHashTable(int size)+
size
- approximate table size.+Method Detail | +
+public void insert(Hashable x)+
x
- the item to insert.+public void remove(Hashable x)+
x
- the item to remove.+public Hashable find(Hashable x)+
x
- the item to search for.+public void makeEmpty()+
+public static int hash(java.lang.String key, + int tableSize)+
key
- the String to hash.tableSize
- the size of the hash table.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.Sort ++
+A class that contains several sorting routines, + implemented as static methods. + Arrays are rearranged with smallest item first, + using compareTo. +
+
+Constructor Summary | +|
Sort()
+
++ |
+
+Method Summary | +|
+static void |
+heapsort(Comparable[] a)
+
++ Standard heapsort. |
+
+static void |
+insertionSort(Comparable[] a)
+
++ Simple insertion sort. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+static void |
+mergeSort(Comparable[] a)
+
++ Mergesort algorithm. |
+
+static void |
+quickSelect(Comparable[] a,
+ int k)
+
++ Quick selection algorithm. |
+
+static void |
+quicksort(Comparable[] a)
+
++ Quicksort algorithm. |
+
+static void |
+shellsort(Comparable[] a)
+
++ Shellsort, using Shell's (poor) increments. |
+
+static void |
+swapReferences(java.lang.Object[] a,
+ int index1,
+ int index2)
+
++ Method to swap to elements in an array. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public Sort()+
+Method Detail | +
+public static void insertionSort(Comparable[] a)+
a
- an array of Comparable items.+public static void shellsort(Comparable[] a)+
a
- an array of Comparable items.+public static void heapsort(Comparable[] a)+
a
- an array of Comparable items.+public static void mergeSort(Comparable[] a)+
a
- an array of Comparable items.+public static void quicksort(Comparable[] a)+
a
- an array of Comparable items.+public static final void swapReferences(java.lang.Object[] a, + int index1, + int index2)+
a
- an array of objects.index1
- the index of the first object.index2
- the index of the second object.+public static void quickSelect(Comparable[] a, + int k)+
a
- an array of Comparable items.k
- the desired rank (1 is minimum) in the entire array.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.SplayTree ++
+Implements a top-down splay tree. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
SplayTree()
+
++ Construct the tree. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the tree. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the tree. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public SplayTree()+
+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.StackAr ++
+Array-based implementation of the stack. +
+
+Constructor Summary | +|
StackAr()
+
++ Construct the stack. |
+|
StackAr(int capacity)
+
++ Construct the stack. |
+
+Method Summary | +|
+ boolean |
+isEmpty()
+
++ Test if the stack is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the stack is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the stack logically empty. |
+
+ void |
+pop()
+
++ Remove the most recently inserted item from the stack. |
+
+ void |
+push(java.lang.Object x)
+
++ Insert a new item into the stack, if not already full. |
+
+ java.lang.Object |
+top()
+
++ Get the most recently inserted item in the stack. |
+
+ java.lang.Object |
+topAndPop()
+
++ Return and remove most recently inserted item from the stack. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public StackAr()+
+public StackAr(int capacity)+
capacity
- the capacity.+Method Detail | +
+public boolean isEmpty()+
+public boolean isFull()+
+public void makeEmpty()+
+public java.lang.Object top()+
+public void pop() + throws Underflow+
Underflow
- if stack is already empty.+public void push(java.lang.Object x) + throws Overflow+
x
- the item to insert.Overflow
- if stack is already full.+public java.lang.Object topAndPop()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.StackLi ++
+List-based implementation of the stack. +
+
+Constructor Summary | +|
StackLi()
+
++ Construct the stack. |
+
+Method Summary | +|
+ boolean |
+isEmpty()
+
++ Test if the stack is logically empty. |
+
+ boolean |
+isFull()
+
++ Test if the stack is logically full. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the stack logically empty. |
+
+ void |
+pop()
+
++ Remove the most recently inserted item from the stack. |
+
+ void |
+push(java.lang.Object x)
+
++ Insert a new item into the stack. |
+
+ java.lang.Object |
+top()
+
++ Get the most recently inserted item in the stack. |
+
+ java.lang.Object |
+topAndPop()
+
++ Return and remove the most recently inserted item from the stack. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public StackLi()+
+Method Detail | +
+public boolean isFull()+
+public boolean isEmpty()+
+public void makeEmpty()+
+public java.lang.Object top()+
+public void pop() + throws Underflow+
Underflow
- if the stack is empty.+public java.lang.Object topAndPop()+
+public void push(java.lang.Object x)+
x
- the item to insert.+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--DataStructures.Treap ++
+Implements a treap. + Note that all "matching" is based on the compareTo method. +
+
+Constructor Summary | +|
Treap()
+
++ Construct the treap. |
+
+Method Summary | +|
+ Comparable |
+find(Comparable x)
+
++ Find an item in the tree. |
+
+ Comparable |
+findMax()
+
++ Find the largest item in the tree. |
+
+ Comparable |
+findMin()
+
++ Find the smallest item in the tree. |
+
+ void |
+insert(Comparable x)
+
++ Insert into the tree. |
+
+ boolean |
+isEmpty()
+
++ Test if the tree is logically empty. |
+
+static void |
+main(java.lang.String[] args)
+
++ |
+
+ void |
+makeEmpty()
+
++ Make the tree logically empty. |
+
+ void |
+printTree()
+
++ Print the tree contents in sorted order. |
+
+ void |
+remove(Comparable x)
+
++ Remove from the tree. |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
+Constructor Detail | +
+public Treap()+
+Method Detail | +
+public void insert(Comparable x)+
x
- the item to insert.+public void remove(Comparable x)+
x
- the item to remove.+public Comparable findMin()+
+public Comparable findMax()+
+public Comparable find(Comparable x)+
x
- the item to search for.+public void makeEmpty()+
+public boolean isEmpty()+
+public void printTree()+
+public static void main(java.lang.String[] args)+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+java.lang.Object + | + +--java.lang.Throwable + | + +--java.lang.Exception + | + +--DataStructures.Underflow ++
+Exception class for access in empty containers + such as stacks, queues, and priority queues. +
+
+Constructor Summary | +|
Underflow()
+
++ |
+
Methods inherited from class java.lang.Throwable | +
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString |
+
Methods inherited from class java.lang.Object | +
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
+Constructor Detail | +
+public Underflow()+
+
+
|
++ + | +|||||||
+ PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES | +|||||||
+ SUMMARY: INNER | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +
+Interfaces
+
+ +Comparable + +Hashable |
+
+Classes
+
+ +AATree + +AvlTree + +BinaryHeap + +BinarySearchTree + +BinomialQueue + +CursorList + +CursorListItr + +DisjSetsFast + +DSL + +LeftistHeap + +LinkedList + +LinkedListItr + +MyInteger + +PairHeap + +PairNode + +QuadraticProbingHashTable + +QueueAr + +Random + +RedBlackTree + +SeparateChainingHashTable + +Sort + +SplayTree + +StackAr + +StackLi + +Treap |
+
+Exceptions
+
+ +Overflow + +Underflow |
+
+
+
|
++ + | +|||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES | +
+Interface Summary | +|
Comparable | +Protocol for Comparable objects. | +
Hashable | +Protocol for Hashable objects. | +
+ +
+Class Summary | +|
AATree | +Implements an AA-tree. | +
AvlTree | +Implements an AVL tree. | +
BinaryHeap | +Implements a binary heap. | +
BinarySearchTree | +Implements an unbalanced binary search tree. | +
BinomialQueue | +Implements a binomial queue. | +
CursorList | +Linked list implementation of the list + using a header node; cursor version. | +
CursorListItr | +Linked list implementation of the list iterator + using a header node; cursor version. | +
DisjSetsFast | +Disjoint set class, using union by rank + and path compression. | +
DSL | +Implements a deterministic skip list. | +
LeftistHeap | +Implements a leftist heap. | +
LinkedList | +Linked list implementation of the list + using a header node. | +
LinkedListItr | +Linked list implementation of the list iterator + using a header node. | +
MyInteger | +Wrapper class for use with generic data structures. | +
PairHeap | +Implements a pairing heap. | +
PairNode | +Public class for use with PairHeap. | +
QuadraticProbingHashTable | +Probing table implementation of hash tables. | +
QueueAr | +Array-based implementation of the queue. | +
Random | +Random number class, using a 31-bit + linear congruential generator. | +
RedBlackTree | +Implements a red-black tree. | +
SeparateChainingHashTable | +Separate chaining table implementation of hash tables. | +
Sort | +A class that contains several sorting routines, + implemented as static methods. | +
SplayTree | +Implements a top-down splay tree. | +
StackAr | +Array-based implementation of the stack. | +
StackLi | +List-based implementation of the stack. | +
Treap | +Implements a treap. | +
+ +
+Exception Summary | +|
Overflow | +Exception class for access in full containers + such as stacks, queues, and priority queues. | +
Underflow | +Exception class for access in empty containers + such as stacks, queues, and priority queues. | +
+
+
+
|
++ + | +|||||||
+ PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
AATree
+ +AvlTree + +BinaryHeap + +BinarySearchTree + +BinomialQueue + +Comparable + +CursorList + +CursorListItr + +DisjSetsFast + +DSL + +Hashable + +LeftistHeap + +LinkedList + +LinkedListItr + +MyInteger + +Overflow + +PairHeap + +PairNode + +QuadraticProbingHashTable + +QueueAr + +Random + +RedBlackTree + +SeparateChainingHashTable + +Sort + +SplayTree + +StackAr + +StackLi + +Treap + +Underflow + + |
+
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+ +++Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
+
+- Interfaces (italic)
- Classes
- Exceptions
- Errors
+ +++Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.- Class inheritance diagram
- Direct Subclasses
- All Known Subinterfaces
- All Known Implementing Classes
- Class/interface declaration
- Class/interface description +
+
- Inner Class Summary
- Field Summary
- Constructor Summary
- Method Summary +
+
- Field Detail
- Constructor Detail
- Method Detail
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with+java.lang.Object
. The interfaces do not inherit fromjava.lang.Object
.+
+- When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
- When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.+
+
+
+
+This help file applies to API documentation generated using the standard doclet.
+
+
+
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+
+
|
++ + | +|||||||
+ PREV + NEXT | ++ FRAMES + NO FRAMES | +
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+Link to Non-frame version.