Sorted Dictionary Assignment

From CSE425S Wiki
Revision as of 15:51, 26 June 2019 by Dennis.cosgrove (talk | contribs) (Created page with " <nowiki>signature DICTIONARY = sig type (''k,'v) dictionary val get : ((''k,'v) dictionary *''k) -> 'v option val put : ((''k,'v) dictionary *''k *'v) -> 'v optio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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

Sorted Implementation

signature SORTED_DICTIONARY = sig include DICTIONARY
   type ''k compare_function = (''k*''k) -> order
   val create_sorted : ''k compare_function -> (''k,'v) dictionary
end