Generic max heap class implementation