Created
July 9, 2017 01:27
-
-
Save kunigami/cb73ebc8d9a69e766b64a28fa087359d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Inserts an element in the heap. | |
*) | |
let insert (elem: tv) (heap: heap): heap = | |
match heap with {digits; schedule} -> | |
let newDigits = insertTree (Node (elem, [])) digits in | |
let newSchedule = execSchedule (newDigits :: schedule) in | |
{digits = newDigits; schedule = newSchedule} | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment