Implementation of a binary heap with basic procedures