DData revision /Bags

Robert Will robertw at stud.tu-ilmenau.de
Fri Mar 19 09:44:11 EST 2004


On Wed, 17 Mar 2004, Christian Maeder wrote:

> Bags are something between Lists and Sets.  Lists become sets by
> changing "++" to "union" being commutative, associative and idempotent,
> Lists become only Bags, when idempotency is omitted.  Thus the order of
> elements does not matter as for Sets, but for Bags the multiplicity is
> important.

Ah!  An Abstract Algebra...

> So either an implemtation as a "Map elem Int"

> or as a sorted list are possible.

Better: ordered balanced trees (easy if you one has abstract balanced
trees to reuse).


Robert


More information about the Libraries mailing list