Skip to content

Instantly share code, notes, and snippets.

View patrick-nicodemus's full-sized avatar

Patrick Nicodemus patrick-nicodemus

View GitHub Profile
@patrick-nicodemus
patrick-nicodemus / stock_file_merge.ml
Created March 16, 2026 16:11
Implementation of a leftist heap in OCaml following Okasaki; application to merge n sequences
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
class Heap:
"""
Fields:
- list _heap
"""
def __init__(self):
self._heap = []