diff --git a/heaps.py b/heaps.py new file mode 100644 index 0000000..d6ac789 --- /dev/null +++ b/heaps.py @@ -0,0 +1,10 @@ +import heapq + +H = [21,1,45,78,3,5] +# Covert to a heap +heapq.heapify(H) +print(H) + +# Add element +heapq.heappush(H,8) +print(H) \ No newline at end of file