This file contains hidden or 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
| class Heap: | |
| """ | |
| Fields: | |
| - list _heap | |
| """ | |
| def __init__(self): | |
| self._heap = [] |
This file contains hidden or 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
| module LeftistHeap(O : Map.OrderedType) : sig | |
| type t (* The type of heaps. *) | |
| type elt = O.t | |
| val empty : t | |
| val push : elt -> t -> t | |
| (** Raises "Not_found" when empty. *) | |
| val pop : t -> elt * t |