First Implementation of natMultset
maxValue
freq
. . .
0
maxValue
Representation Invariant: For each k in the range 0..maxValue, the frequency of item k in the multiset is freq[k].
public class NatMultiset
{
/* For each k in range 0..maxValue,
frequency of k in multiset is freq[k]. */
private int maxValue;
private int[] freq;
/* methods */
. . .
}
Previous slide
Next slide
Back to first slide
View graphic version