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?