Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type HeapNode<'a> =
- { priority : int
- value : 'a
- parent : Heap<'a>
- left : Heap<'a>
- right : Heap<'a> }
- and Heap<'a> =
- | Empty
- | Node of HeapNode<'a>
- module Heap =
- let private getWith f h =
- match h with
- | Empty -> failwith "empty"
- | Node hn -> f hn
- let priority h = h |> getWith (fun hn -> hn.priority)
- let value h = h |> getWith (fun hn -> hn.value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement