Difference between revisions of "Chained Dictionary Assignment"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
[https://en.wikipedia.org/wiki/Hash_table Hash table] | [https://en.wikipedia.org/wiki/Hash_table Hash table] | ||
+ | |||
+ | [[File:Hash table 5 0 1 1 1 1 1 LL.svg]] | ||
<nowiki>signature HASHED_DICTIONARY = sig include DICTIONARY | <nowiki>signature HASHED_DICTIONARY = sig include DICTIONARY |
Revision as of 15:47, 25 June 2019
signature DICTIONARY = sig type (''k,'v) dictionary val get : ((''k,'v) dictionary *''k) -> 'v option val put : ((''k,'v) dictionary *''k *'v) -> 'v option val remove : ((''k,'v) dictionary *''k) -> 'v option val entries : (''k,'v) dictionary -> (''k*'v) list val keys : (''k,'v) dictionary -> ''k list val values : (''k,'v) dictionary -> 'v list end
SingleList Implementation
signature SINGLE_LIST_DICTIONARY = sig include DICTIONARY val create_simple : unit -> (''k,'v) dictionary end
Hashtable Implementation
signature HASHED_DICTIONARY = sig include DICTIONARY type ''k hash_function = ''k -> int val create_hashed : (int * ''k hash_function) -> (''k,'v) dictionary end