Support for Min and Max heaps