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.
-
Field Details
-
N
-
first
-
-
Constructor Details
-
Bag
public Bag()Create an empty stack.
-
-
Method Details