Interest in a (mutable) binomial heap in Stdlib

IMO it’d be fairly useful - batteries has one, but they’re inductive, not array-backed, and immutable. There’s precedent for large-storage datastructures in Hashtbl, which I feel is “morally” similar.
They wouldn’t be a pain to implement, but like Hashtbl, it’s slightly more then you’d want to do in every project, and they’re pretty applicable to a lot of tasks (especially with the new features from 5.0).

There’s an implementation of a heap in the examples for Dynarray, that if extended with a set of useful functions (like what’s been done with Hashtbl) would be suitable, I would think.

Opinions?

Stdlib priority queues by backtracking · Pull Request #12871 · ocaml/ocaml · GitHub :slight_smile:

Cheers,
Nicolas

2 Likes

Apologies, I did do a search but must have missed searching for a priority queue as opposed to a heap.
Good to know that it’s not a bad idea, I suppose :smile: