Heap data structures are used to implement Priority Queues, where the important operations are insert a new element and delete the maximum element. The Heap is a tree data structure that can implement these operations in logN time. But for some algorithms we also need to be able to join (i.e., merge) two priority queues efficiently, and ordinary heaps take N time to do that. A more sophisticated data structure, the Binomial Heap, can do this in logN time as well.

In addition, if the heap is implemented as a purely functional program, then one can revert to previous versions of the data structure in constant time; this is often useful.

Section 9.7 of Sedgewick's Algorithms 3rd Edition in Java explains the Binomial Heap data structure, and you should read that first. Then follow the instructions in binom.ml.

The reference manual for Objective Caml is here. I found that the most useful sections are:

Ocaml is available here for Linux, Macintosh, and Windows. It is preinstalled in many Linux (and cygwin) installations.

You may find it most convenient to run it in a shell inside emacs.

Note: When you edit a ".ml" file, Emacs by default puts you in "Lisp" mode, which is not useful for the Caml programming language. You can give the command ESC-X-"fundamental-mode" to get back in normal mode.