Give me a practical use-case of Multi-set

后端 未结 4 1704
庸人自扰
庸人自扰 2020-12-16 14:38

I would like to know a few practical use-cases (if they are not related/tied to any programming language it will be better).I can associate Sets, Lists and Maps to practical

4条回答
  •  独厮守ぢ
    2020-12-16 15:07

    Lots of applications. For example, imagine a shopping cart. That can contain more than one instance of an item - i.e. 2 cpu's, 3 graphics boards, etc. So it is a Multi-set. One simple implementation is to also keep track of the number of items of each - i.e. keep around the info 2 cpu's, 3 graphics boards, etc.

    I'm sure you can think of lots of other applications.

提交回复
热议问题