“multiset” & “multimap” - What's the point?

后端 未结 7 1699
孤城傲影
孤城傲影 2020-12-08 18:58

As the question states ... I don\'t get the point about multisets / multimaps.

So, what\'s the purpose?

7条回答
  •  长情又很酷
    2020-12-08 19:28

    Here's what Wikipedia says about uses:

    • In a student enrollment system, where students may be enrolled in multiple classes simultaneously, there might be an association for each enrollment of a student in a course, where the key is the student ID and the value is the course ID. If a student is enrolled in three courses, there will be three associations containing the same key.
    • The index of a book may report any number of references for a given index term, and thus may be coded as a multimap from index terms to any number of reference locations

提交回复
热议问题