the best heap implementation ever made using python with heap sort for ascending and desending order
some examples :
obj = HeapQueue(data=[5,8,1,4,8,2,8,2,9], max_priority=True)
obj.sort(ascending=True)
obj2 = HeapQueue(data=[5,8,1,4,8,2,8,2,9], max_priority=True)
obj2.sort(ascending=False)
obj3 = HeapQueue(data=[5,8,1,4,8,2,8,2,9], max_priority=False)
obj3.sort(ascending=True)
obj4 = HeapQueue(data=[5,8,1,4,8,2,8,2,9], max_priority=False)
obj4.sort(ascending=False)
print(obj)
print(obj2)
print(obj3)
print(obj4)