Package algs13
Class Bag<T>
java.lang.Object
algs13.Bag<T>
- All Implemented Interfaces:
Iterable<T>
The
Bag
class represents a bag (or multiset) of
generic items. It supports insertion and iterating over the
items in arbitrary order.
The add, isEmpty, and size operation take constant time. Iteration takes time proportional to the number of items.
For additional documentation, see Section 1.3 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
N
-
first
-
-
Constructor Details
-
Bag
public Bag()Create an empty stack.
-
-
Method Details