Adapt the binary heap to support generic types