Difference between revisions of "Sorted Dictionary Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 1: Line 1:
  <nowiki>signature DICTIONARY = sig
+
  {{Dictionary_Assignment}}
    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</nowiki>
 
 
=Code To Use=
 
=Code To Use=
 
[[Binary_Tree_Assignment|Binary Tree Studio]]
 
[[Binary_Tree_Assignment|Binary Tree Studio]]

Revision as of 20:52, 2 March 2020

Template:Dictionary Assignment

Code To Use

Binary Tree Studio

Code To Implement

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