Heap data structure can be used to implement