How can i add the input list to heap directly?,Where some of the inbuild function used to push,get min,extract min but how to extract the maximum from the heap. some functions like..
heapify(iterable) :- This function is used to convert the iterable into a heap data structure. i.e. in heap order.
heappush(heap, ele) :- This function is used to insert the element mentioned in its arguments into heap. The order is adjusted, so as heap structure is maintained.
heappop(heap) :- This function is used to remove and return the smallest element from heap. The order is adjusted, so as heap structure is maintained.
heap = []
heapify(heap)
heappush(heap, 10)
heappush(heap, 30)
heappush(heap, 20)
heappush(heap, 400)
# printing the elements of the heap
for i in heap:
print( i, end = ' ')
print("\n")