A B C D E F G H I K L M N O P Q R S T
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- addEdge(int, int) - Method in interface cpsc331.collections.Graph
-
Adds an edge to this graph.
- ArrayQueue<E> - Class in cpsc331.collections
-
Provides an implementation of a BoundedQueue using a BoundedArray.
- ArrayQueue(int) - Constructor for class cpsc331.collections.ArrayQueue
-
Creates an ArrayQueue whose size and capacity are both equal to the input maxSize, and whose entries are all null, if this is a positive int - throwing an IllegalArgumentException if the input maxSize is negative, instead.
- ArrayStack<E> - Class in cpsc331.collections
-
Provides an implementation of a BoundedStack using a BoundedArray.
- ArrayStack(int) - Constructor for class cpsc331.collections.ArrayStack
-
Creates an initially empty bounded stack whose capacity is the input maxSize, if this is a positive int - throwing an IllegalArgumentException if maxSize is negative, instead.
B
- BoundedArray<E> - Class in cpsc331.collections
-
Provides an implementation of a bounded array that supports generic programming.
- BoundedArray(int) - Constructor for class cpsc331.collections.BoundedArray
-
Creates a bounded array whose length is the input len, and whose entries are all null, if len is a positive integer - throwing an IllegalArgumentException if len is less than or equal to zero
- BoundedMaxHeap<T extends java.lang.Comparable<T>> - Interface in cpsc331.collections
-
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 MaxHeap - BoundedMinHeap<T extends java.lang.Comparable<T>> - Interface in cpsc331.collections
-
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 MinHeap - BoundedQueue<E> - Interface in cpsc331.collections
-
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> - Interface in cpsc331.collections
-
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. - BSTDictionary<K extends java.lang.Comparable<K>,V> - Class in cpsc331.collections
-
Provides an implementation of a Dictionary using a binary search tree.
- BSTDictionary() - Constructor for class cpsc331.collections.BSTDictionary
-
Constructs an empty BSTDictionary
Preconditions: None
Postcondition: An empty BSTDictionary (satisfying the above BSTDictionary Invariant) has been created.
C
- capacity() - Method in class cpsc331.collections.ArrayQueue
- capacity() - Method in class cpsc331.collections.ArrayStack
- capacity() - Method in interface cpsc331.collections.BoundedQueue
-
Reports the capacity of this bounded queue.
- capacity() - Method in interface cpsc331.collections.BoundedStack
-
Reports the capacity of this bounded stack.
- ChainHashFunction<E> - Interface in cpsc331.collections
-
Provides an interface for a hash function that can be used by a hash table with chaining.
- ChainHashMap<K,V> - Class in cpsc331.collections
-
Implements a Mapping using a hash table with chaining..
- ChainHashMap() - Constructor for class cpsc331.collections.ChainHashMap
-
Default constructor uses a hash table with size 23.
- ChainHashMap(int) - Constructor for class cpsc331.collections.ChainHashMap
-
Constructor receives table size as input.
- ChainHashSet<E> - Class in cpsc331.collections
-
Implements a Set using a hash table with chaining.
- ChainHashSet() - Constructor for class cpsc331.collections.ChainHashSet
-
Default constructor uses a hash table with size 23.
- ChainHashSet(int) - Constructor for class cpsc331.collections.ChainHashSet
-
Constructor receives table size as input.
- ChainHashTable<K,V> - Class in cpsc331.collections
-
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.
- ChainHashTable(int) - Constructor for class cpsc331.collections.ChainHashTable
-
Creates an empty hash table.
- change(K, V, BSTDictionary.BSTNode) - Method in class cpsc331.collections.BSTDictionary
- contains(E) - Method in class cpsc331.collections.ChainHashSet
- contains(E) - Method in class cpsc331.collections.OpenHashSet
- contains(E) - Method in interface cpsc331.collections.Set
-
Reports whether a given element belongs to this set.
- cpsc331 - package cpsc331
- cpsc331.collections - package cpsc331.collections
D
- defined(K) - Method in class cpsc331.collections.ChainHashTable
-
Reports whether a value for a given key k is defined.
- defined(K) - Method in interface cpsc331.collections.Mapping
- defined(K) - Method in class cpsc331.collections.NewOpenHashTableDouble
-
Reports whether a value for a given key k is defined.
- defined(K) - Method in class cpsc331.collections.OpenHashTableDouble
-
Reports whether a value for a given key k is defined.
- degree(int) - Method in interface cpsc331.collections.Graph
-
Returns the degree of an input vertex.
- deleteMax() - Method in interface cpsc331.collections.BoundedMaxHeap
- deleteMax() - Method in interface cpsc331.collections.MaxHeap
- deleteMin() - Method in interface cpsc331.collections.BoundedMinHeap
- deleteMin() - Method in interface cpsc331.collections.MinHeap
- Dictionary<K extends java.lang.Comparable<K>,V> - Interface in cpsc331.collections
-
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.
E
- EdgeFoundException - Exception in cpsc331.collections
-
Exception to be thrown if an attempt is made to add an edge to a graph when this edge already exists.
- EdgeFoundException(String) - Constructor for exception cpsc331.collections.EdgeFoundException
-
Constructs an EdgeFoundException with the specified message.
- edges() - Method in interface cpsc331.collections.Graph
-
Returns the edges in this graph.
- ElementFoundException - Exception in cpsc331.collections
-
Exception to be thrown if an attempt is made to add an element to a set when this element already belongs to it.
- ElementFoundException(String) - Constructor for exception cpsc331.collections.ElementFoundException
-
Constructs an ElementFoundException with the specified message.
- equals(KeyValuePair<K, V>) - Method in class cpsc331.collections.KeyValuePair
-
Implements a test for equality, based on key values.
- eval(int) - Static method in class cpsc331.Fibonacci
-
Computes the nth Fibonacci number, Fn, throwing an IllegalArgumentException if n is negative.
F
- Fibonacci - Class in cpsc331
-
A class for the computation of Fibonacci numbers.
- Fibonacci() - Constructor for class cpsc331.Fibonacci
G
- get(int) - Method in class cpsc331.collections.BoundedArray
-
Returns the entry at a given index, if that index is non-negative and less than the length of this bounded array - throwing an ArrayIndexOutOfBoundsException otherwise.
- get(K) - Method in class cpsc331.collections.BSTDictionary
- get(K) - Method in class cpsc331.collections.ChainHashMap
- get(K) - Method in interface cpsc331.collections.Mapping
-
Returns the value associated with a given key, throwing a NoSuchElementException if no value is currently associated with the given key.
- get(K) - Method in class cpsc331.collections.OpenHashMap
- getCapacity() - Method in interface cpsc331.collections.BoundedMaxHeap
- getCapacity() - Method in interface cpsc331.collections.BoundedMinHeap
- getKey() - Method in class cpsc331.collections.KeyValuePair
-
Reports the key of this KeyValuePair.
- getSize() - Method in interface cpsc331.collections.BoundedMaxHeap
- getSize() - Method in interface cpsc331.collections.BoundedMinHeap
- getSize() - Method in interface cpsc331.collections.MaxHeap
- getSize() - Method in interface cpsc331.collections.MinHeap
- getValue() - Method in class cpsc331.collections.KeyValuePair
-
Reports the value of this KeyValuePair.
- Graph - Interface in cpsc331.collections
-
Provides an interface for a simple undirected graph.
H
- hashValue(E) - Method in interface cpsc331.collections.ChainHashFunction
-
Reports the hash value for a given value
- hashValue(E) - Method in class cpsc331.collections.SimpleChainHashFunction
- hashValue(E, int) - Method in interface cpsc331.collections.OpenHashFunction
-
Reports the hash value for a given value and probe index
- hashValue(E, int) - Method in class cpsc331.collections.OpenHashFunctionDouble
- hasNext() - Method in class cpsc331.collections.NewOpenHashTableDouble.Iter
- HeapFullException - Exception in cpsc331.collections
-
Exception to be on an attempt to insert an element into a bounded binary heap when the heap is full
- HeapFullException(String) - Constructor for exception cpsc331.collections.HeapFullException
I
- include(E) - Method in class cpsc331.collections.ChainHashSet
- include(E) - Method in class cpsc331.collections.OpenHashSet
- include(E) - Method in interface cpsc331.collections.Set
-
Adds an input element to this set, throwing an ElementFoundException if this element already belongs to it.
- insert(E) - Method in class cpsc331.collections.ArrayQueue
- insert(E) - Method in interface cpsc331.collections.BoundedQueue
-
Inserts a new entry onto the queue.
- insert(E) - Method in class cpsc331.collections.ListQueue
- insert(E) - Method in interface cpsc331.collections.Queue
-
Inserts a new object onto the queue.
- insert(T) - Method in interface cpsc331.collections.BoundedMaxHeap
- insert(T) - Method in interface cpsc331.collections.BoundedMinHeap
- insert(T) - Method in interface cpsc331.collections.MaxHeap
- insert(T) - Method in interface cpsc331.collections.MinHeap
- isEdge(int, int) - Method in interface cpsc331.collections.Graph
-
Reports whether an edge from a given vertex to another given vertex exists.
- isEmpty() - Method in class cpsc331.collections.ArrayQueue
- isEmpty() - Method in class cpsc331.collections.ArrayStack
- isEmpty() - Method in interface cpsc331.collections.BoundedQueue
-
Reports whether the queue is currently empty without changing it.
- isEmpty() - Method in interface cpsc331.collections.BoundedStack
-
Reports whether the stack is currently empty without changing it.
- isEmpty() - Method in class cpsc331.collections.ListQueue
- isEmpty() - Method in class cpsc331.collections.ListStack
- isEmpty() - Method in interface cpsc331.collections.Queue
-
Reports whether the queue is currently empty without changing it.
- isEmpty() - Method in interface cpsc331.collections.Stack
-
Reports whether the stack is currently empty without changing it.
- Iter() - Constructor for class cpsc331.collections.NewOpenHashTableDouble.Iter
K
- KeyValuePair<K,V> - Class in cpsc331.collections
-
Implements a key-value pair of keys with type K and values with type V
KeyValuePair Invariant:
key has type K value has type V - KeyValuePair() - Constructor for class cpsc331.collections.KeyValuePair
-
Constructs a key-value pair such that the key and value are both null.
L
- length() - Method in class cpsc331.collections.BoundedArray
-
Returns the length of this bounded array
- ListQueue<E> - Class in cpsc331.collections
-
Provides an implementation of a Queue using a singly linked list:
All operations require constant time in the worst case. - ListQueue() - Constructor for class cpsc331.collections.ListQueue
-
Creates a linked list representing an empty queue.
- ListStack<E> - Class in cpsc331.collections
-
Provides an implementation of a Stack using a singly linked list:
All operations require constant time in the worst case. - ListStack() - Constructor for class cpsc331.collections.ListStack
-
Creates a linked list representing an empty stack.
M
- main(String[]) - Static method in class cpsc331.collections.TestOpenHashTableDouble
- main(String[]) - Static method in class cpsc331.Fibonacci
-
The main method for this class.
- Mapping<K,V> - Interface in cpsc331.collections
-
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>> - Interface in cpsc331.collections
-
Provides an interface for an unbounded binary MaxHeap
MaxHeap Invariant: A finite multiset of values of ordered type T is stored in a binary MaxHeap - MinHeap<T extends java.lang.Comparable<T>> - Interface in cpsc331.collections
-
Provides an interface for an unbounded binary MinHeap
MinHeap Invariant: A finite multiset of values of ordered type T is stored in a binary MinHeap
N
- neighbours(int) - Method in interface cpsc331.collections.Graph
-
Returns the neighbours of a given vertex.
- NewOpenHashTableDouble<K,V> - Class in cpsc331.collections
-
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.
- NewOpenHashTableDouble(int) - Constructor for class cpsc331.collections.NewOpenHashTableDouble
-
Creates an empty hash table.
- NewOpenHashTableDouble.Iter - Class in cpsc331.collections
-
Provides an Iterator for this hash table
- next() - Method in class cpsc331.collections.NewOpenHashTableDouble.Iter
- NoSuchEdgeException - Exception in cpsc331.collections
-
Exception to be thrown if an attempt is made to access an edge in a graph when this edge does not exist.
- NoSuchEdgeException(String) - Constructor for exception cpsc331.collections.NoSuchEdgeException
-
Constructs a NoSuchEdgeException with the specified message.
- numberEdges() - Method in interface cpsc331.collections.Graph
-
Returns the number of edges in this graph.
- numberVertices() - Method in interface cpsc331.collections.Graph
-
Reports the number of vertices in this graph.
O
- OpenHashFunction<E> - Interface in cpsc331.collections
-
Provides an interface for a hash function that can be used by a hash table with open addressing
- OpenHashFunctionDouble<E> - Class in cpsc331.collections
-
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. - OpenHashFunctionDouble(int) - Constructor for class cpsc331.collections.OpenHashFunctionDouble
-
Provides a hash function for hash table with open addressing, for a given table size.
- OpenHashMap<K,V> - Class in cpsc331.collections
-
Implements a Mapping using a hash table with open addressing.
- OpenHashMap() - Constructor for class cpsc331.collections.OpenHashMap
-
Default constructor uses a hash table with size 23.
- OpenHashMap(int) - Constructor for class cpsc331.collections.OpenHashMap
-
Constructor receives table size as input.
- OpenHashSet<E> - Class in cpsc331.collections
-
Implements a Set using a hash table with open addressing
- OpenHashSet() - Constructor for class cpsc331.collections.OpenHashSet
-
Default constructor uses a hash table with size 16.
- OpenHashSet(int) - Constructor for class cpsc331.collections.OpenHashSet
-
Constructor receives table size as input.
- OpenHashTableDouble<K,V> - Class in cpsc331.collections
-
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.
- OpenHashTableDouble(int) - Constructor for class cpsc331.collections.OpenHashTableDouble
-
Creates an empty hash table.
- OrderedSet<E extends java.lang.Comparable<E>> - Interface in cpsc331.collections
-
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.
P
- peek() - Method in class cpsc331.collections.ArrayQueue
- peek() - Method in class cpsc331.collections.ArrayStack
- peek() - Method in interface cpsc331.collections.BoundedQueue
-
Reports the element at the front of the queue without changing it.
- peek() - Method in interface cpsc331.collections.BoundedStack
-
Reports the top element of the stack without changing it.
- peek() - Method in class cpsc331.collections.ListQueue
- peek() - Method in class cpsc331.collections.ListStack
- peek() - Method in interface cpsc331.collections.Queue
-
Reports the front element of the queue without changing it.
- peek() - Method in interface cpsc331.collections.Stack
-
Reports the top element of the stack without changing it.
- pop() - Method in class cpsc331.collections.ArrayStack
- pop() - Method in interface cpsc331.collections.BoundedStack
-
Removes an element from the top of the stack and reports it.
- pop() - Method in class cpsc331.collections.ListStack
- pop() - Method in interface cpsc331.collections.Stack
-
Removes an element from the top of the stack and reports it.
- push(E) - Method in class cpsc331.collections.ArrayStack
- push(E) - Method in interface cpsc331.collections.BoundedStack
-
Pushes a new entry onto the stack.
- push(E) - Method in class cpsc331.collections.ListStack
- push(E) - Method in interface cpsc331.collections.Stack
-
Pushes a new entry onto the stack.
Q
- Queue<E> - Interface in cpsc331.collections
-
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). - QueueFullException - Exception in cpsc331.collections
-
Exception to be thrown if a BoundedQueue is full and an attempt is made to insert another element onto it
R
- remove() - Method in class cpsc331.collections.ArrayQueue
- remove() - Method in interface cpsc331.collections.BoundedQueue
-
Removes an element from the front of the queue and reports it.
- remove() - Method in class cpsc331.collections.ListQueue
- remove() - Method in interface cpsc331.collections.Queue
-
Removes an element from the front of the stack and reports it.
- remove(E) - Method in class cpsc331.collections.ChainHashSet
- remove(E) - Method in class cpsc331.collections.OpenHashSet
- remove(E) - Method in interface cpsc331.collections.Set
-
Removes an input element to this set, throwing a NoSuchElementException if this element does not belong to it.
- remove(K) - Method in class cpsc331.collections.BSTDictionary
- remove(K) - Method in class cpsc331.collections.ChainHashMap
- remove(K) - Method in class cpsc331.collections.ChainHashTable
-
Sets the value for a given key to be undefined.
- remove(K) - Method in interface cpsc331.collections.Mapping
-
Removes the ordered pair with a given input key k, returning a NoSuchElementException and leaving the Mapping unchanged if no such ordered pair exists.
- remove(K) - Method in class cpsc331.collections.NewOpenHashTableDouble
-
Sets the value for a given key to be undefined.
- remove(K) - Method in class cpsc331.collections.OpenHashMap
- remove(K) - Method in class cpsc331.collections.OpenHashTableDouble
-
Sets the value for a given key to be undefined.
- removeEdge(int, int) - Method in interface cpsc331.collections.Graph
-
Removes an edge from this graph.
S
- search(K) - Method in class cpsc331.collections.ChainHashTable
-
Searches for the value associated with a given key, throwing an exception if no such value is defined.
- search(K) - Method in class cpsc331.collections.NewOpenHashTableDouble
-
Searches for the value associated with a given key, throwing an exception if no such value is defined.
- search(K) - Method in class cpsc331.collections.OpenHashTableDouble
-
Searches for the value associated with a given key, throwing an exception if no such value is defined.
- set(int, E) - Method in class cpsc331.collections.BoundedArray
-
Sets the entry at a given index to be a given value, if the index is non-negative and less than the length of this bounded array - throwing an ArrayIndexOutOfBoundsException otherwise.
- set(K, V) - Method in class cpsc331.collections.BSTDictionary
- set(K, V) - Method in class cpsc331.collections.ChainHashMap
- set(K, V) - Method in class cpsc331.collections.ChainHashTable
-
Sets the value associated with an input key k to be an input value v.
- set(K, V) - Method in interface cpsc331.collections.Mapping
-
Sets the value associated with an input key to be an input value — replacing the value formerly associated with this key if one already exists.
- set(K, V) - Method in class cpsc331.collections.NewOpenHashTableDouble
-
Sets the value associated with an input key k to be an input value v.
- set(K, V) - Method in class cpsc331.collections.OpenHashMap
- set(K, V) - Method in class cpsc331.collections.OpenHashTableDouble
-
Sets the value associated with an input key k to be an input value v.
- Set<E> - Interface in cpsc331.collections
-
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. - setKey(K) - Method in class cpsc331.collections.KeyValuePair
-
Sets the key to be the input received.
- setValue(V) - Method in class cpsc331.collections.KeyValuePair
-
Sets the value to be the input received.
- SimpleChainHashFunction<E> - Class in cpsc331.collections
-
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 function
- SimpleChainHashFunction(int) - Constructor for class cpsc331.collections.SimpleChainHashFunction
-
Provides a hash function for a hash table with chaining, for a given table size
- Stack<E> - Interface in cpsc331.collections
-
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. - StackFullException - Exception in cpsc331.collections
-
Exception to be thrown if a BoundedStack is full and an attempt is made to pop another element onto it
T
- TableFullException - Exception in cpsc331.collections
-
Exception to be on an attempt to insert an element into a hash table with open addressing when the table is full
- TestOpenHashTableDouble - Class in cpsc331.collections
- TestOpenHashTableDouble() - Constructor for class cpsc331.collections.TestOpenHashTableDouble
- testRemove(Integer, String, boolean) - Static method in class cpsc331.collections.TestOpenHashTableDouble
All Classes All Packages