# What is Heap and how to implement min heap and max heap in python?
A heap is a data structure based on a tree in which all of the tree's nodes are arranged in a predefined order.
The heap is one of the most efficient implementations of an abstract data type known as a priority queue, and priority queues are frequently referred to as "heaps" regardless of how they are implemented. The element with the highest (or lowest) priority is always kept at the root of a heap. A heap, on the other hand, is not a sorted structure; it can be considered somewhat ordered. When it's essential to repeatedly delete the object with the highest (or lowest) priority, a heap is a handy data structure.
for more detailes, please read the full article [Heap in Python](https://favtutor.com/blogs/heap-in-python)