Skip to content
illyfrancis edited this page Jul 18, 2013 · 14 revisions

Multisets

  • Type of collection
Collection behaviour
  • Can it have duplicates?
  • Is ordering significant? (for equals())
  • Iteration order
    • insertion-ordered? (Linked list) comparator-ordered? (Tree) user-ordered? (Array)
    • something else well-defined?
    • or it just doesn't matter?

In general, the first two determine the interface type, and the third tends to influce your choice of implementation

List vs. Set
  • Set: unordered equality, no dups

  • List: ordered equauality, can have dups

    Ordered?

Multiset: unordered equality, can have dups

Clone this wiki locally