For faster navigation, this Iframe is preloading the Wikiwand page for 多重关连数组.

多重关连数组

电脑科学中,多重关连数组(英语:multimap),是一种抽象数据结构,它存储著(键,值)的有序对,和map不同之处在于,多重关连数组的有序对可以重复。通常,多重关连数组是利用在map中使用串列集合当作值的字段。

这种数据结构包含以下几种常见操作:
  • 向关系数组添加配对
  • 从关系数组内删除配对
  • 修改关系数组内的配对
  • 根据已知的键查找配对

使用模式

[编辑]
  • 当需要对一同一个键值存储大量资料时,可以使用多重关连数组。
  • 举例来说,在学生选课系统中,一个学生可以选择多门课程,可以使用多重关连数组,将有序对(学生ID, 课程ID)存入多重关连数组中。

语言支持

[编辑]

C++

[编辑]

C++标准模板库提供利用平衡树来实现多重关连数组,[1] ,且SGI的标准模板库提供了利用散列表hash_multimap [2]

Dart

[编辑]

由Quiver提供。[3]

参见

[编辑]

参考文献

[编辑]
  1. ^ "multimap<Key, Data, Compare, Alloc>"页面存档备份,存于互联网档案馆).
  2. ^ "hash_multimap<Key, HashFcn, EqualKey, Alloc>"页面存档备份,存于互联网档案馆).
  3. ^ "Multimap"页面存档备份,存于互联网档案馆).
{{bottomLinkPreText}} {{bottomLinkText}}
多重关连数组
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?