We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fad614 commit e8e6fe5Copy full SHA for e8e6fe5
1 file changed
ultimatepython/data_structures/heap.py
@@ -1,3 +1,11 @@
1
+"""
2
+A heap is a specialized tree-based data structure that satisfies the heap
3
+property: in a min-heap every parent node is smaller than or equal to its
4
+children, and in a max-heap every parent is greater than or equal to its
5
+children. This module demonstrates how to build and interact with both
6
+min-heaps and max-heaps using Python's built-in heapq module.
7
8
+
9
import heapq
10
11
0 commit comments