mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
Update heapq description
This commit is contained in:
1 parent
cba7da3f8c
commit
4e4a82e08f
1 file changed
+1
-1
@@ -300,7 +300,7 @@ heapq.heapify(myList)
|
||||
x = heapq.heappop(myList)
|
||||
print(-x) # => 9 (making sure to multiply by -1 again)
|
||||
```
|
||||
Heaps are binary trees for which every parent node has a value less than or equal to any of its children. Useful for accessing min/max value quickly. See: [Heapq](https://docs.python.org/3/library/heapq.html)
|
||||
Heaps are binary trees for which every parent node has a value less than or equal to any of its children. Useful for accessing min/max value quickly. Time complexity: O(n) for heapify, O(log n) push and pops. See: [Heapq](https://docs.python.org/3/library/heapq.html)
|
||||
|
||||
### Stacks and Queues {.row-span-3}
|
||||
```python
|
||||
|
||||
Reference in new issue
Block a user