Package cpsc331.collections
-
Interface Summary Interface Description BoundedMaxHeap<T extends java.lang.Comparable<T>> Provides an interface for an bounded binary MaxHeap
BoundedMaxHeap Invariant: A finite multiset of values of ordered type T is stored in a bounded binary MaxHeapBoundedMinHeap<T extends java.lang.Comparable<T>> Provides an interface for an bounded binary MinHeap
BoundedMinHeap Invariant: A finite multiset of values of ordered type T is stored in a bounded binary MinHeapBoundedQueue<E> Provides an interface for an bounded queue whose elements are of type E.
BoundedQueue Invariant: A collection of objects of type E is maintained in first-in first-out order: The object that is visible at the front of the queue is the object that was first inserted onto it, and not yet removed.BoundedStack<E> Provides an interface for a bounded stack whose elements are of type E.
BoundedStack Invariant: A collection of objects of type E is maintained in last-in first-out order: The object that is visible at the top of the stack is the object that has most recently been pushed onto it, and not yet removed.ChainHashFunction<E> Provides an interface for a hash function that can be used by a hash table with chaining.Dictionary<K extends java.lang.Comparable<K>,V> Provides an interface for a mapping when there is a total order on the set of keys.
Dictionary Invariant: A finite collection S of pairs (k, v) of values where k has type K and is not ulll, such that there is a total order on K, and values v of type K is maintained.Graph Provides an interface for a simple undirected graph.Mapping<K,V> Provides an interface for a mapping whose keys are of type K and whose values are of type E.
Mapping Invariant: A finite collection S of pairs (k, v) of values where k has type K and is not null, and v has type V, is maintained.MaxHeap<T extends java.lang.Comparable<T>> Provides an interface for an unbounded binary MaxHeap
MaxHeap Invariant: A finite multiset of values of ordered type T is stored in a binary MaxHeapMinHeap<T extends java.lang.Comparable<T>> Provides an interface for an unbounded binary MinHeap
MinHeap Invariant: A finite multiset of values of ordered type T is stored in a binary MinHeapOpenHashFunction<E> Provides an interface for a hash function that can be used by a hash table with open addressingOrderedSet<E extends java.lang.Comparable<E>> Provides an interface for a whose elements have type E, where E has a total order.
OrderedSet Invariant: A finite set of non-null elements of type E (which has a total order) is maintained.Queue<E> Provides an interface for an unbounded queue whose elements are of type E.
Queue Invariant: A collection of objects of type E is maintained in first-in first-out order: The object that is visible at the front of the queue is the object that has was first inserted onto it (that has not yet been removed).Set<E> Provides an interface for a set whose elements have type E.
Set Invariant: A finite set of non-null elements of type E is maintained.Stack<E> Provides an interface for an unbounded stack whose elements are of type E.
Stack Invariant: A collection of objects of type E is maintained in last-in first-out order: The object that is visible at the top of the stack is the object that has most recently been pushed onto it, and not yet removed. -
Class Summary Class Description ArrayQueue<E> Provides an implementation of a BoundedQueue using a BoundedArray.ArrayStack<E> Provides an implementation of a BoundedStack using a BoundedArray.BoundedArray<E> Provides an implementation of a bounded array that supports generic programming.BSTDictionary<K extends java.lang.Comparable<K>,V> Provides an implementation of a Dictionary using a binary search tree.ChainHashMap<K,V> Implements a Mapping using a hash table with chaining..ChainHashSet<E> Implements a Set using a hash table with chaining.ChainHashTable<K,V> Implements a hash table with chaining that can be used to implement either a Set or a Mapping: Table entries store ordered pairs of keys and values.KeyValuePair<K,V> Implements a key-value pair of keys with type K and values with type V
KeyValuePair Invariant:
key has type K value has type VListQueue<E> Provides an implementation of a Queue using a singly linked list:
All operations require constant time in the worst case.ListStack<E> Provides an implementation of a Stack using a singly linked list:
All operations require constant time in the worst case.NewOpenHashTableDouble<K,V> Implements a hash table with open addressing that can be used to implement either a Set or Mapping: Table entries store ordered pairs of keys and values.OpenHashFunctionDouble<E> Provides an implementation of an OpenHashFunction — that is, a class providing a hash function for a has table with open addressing — using double hashing, and by using Java’s hashCode function to provide the first has function needed, along with the use of this function together with a randomly generated constant to provide the second
This implementation is designed to guarantee termination of algorithms when the table size is a sufficiently large power of two.OpenHashMap<K,V> Implements a Mapping using a hash table with open addressing.OpenHashSet<E> Implements a Set using a hash table with open addressingOpenHashTableDouble<K,V> Implements a hash table with open addressing that can be used to implement either a Set or Mapping: Table entries store ordered pairs of keys and values.SimpleChainHashFunction<E> Provides an implementation of a ChainHashFunction — that is, a class providing a hash function for a hash table with chaining — by making a straightforward use of Java’s hashCode functionTestOpenHashTableDouble -
Exception Summary Exception Description EdgeFoundException Exception to be thrown if an attempt is made to add an edge to a graph when this edge already exists.ElementFoundException Exception to be thrown if an attempt is made to add an element to a set when this element already belongs to it.HeapFullException Exception to be on an attempt to insert an element into a bounded binary heap when the heap is fullNoSuchEdgeException Exception to be thrown if an attempt is made to access an edge in a graph when this edge does not exist.QueueFullException Exception to be thrown if a BoundedQueue is full and an attempt is made to insert another element onto itStackFullException Exception to be thrown if a BoundedStack is full and an attempt is made to pop another element onto itTableFullException Exception to be on an attempt to insert an element into a hash table with open addressing when the table is full