Skip to content

Commit ed22d26

Browse files
committed
add vancanhuit's Heap code
1 parent ce3f732 commit ed22d26

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

data_structure/binary_heap_implements_priority_queues.md

+2
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,5 @@ Binary heap operation is very simple, mainly floating up and down, to maintain t
211211
Priority queues are implemented based on binary heap, with the main operations being insert and delete. Insert is to insert to the end first and then float up to the correct position; Deletion is to reverse the position and then delete, and then sink to the correct position. The core code is only ten lines.
212212

213213
Perhaps this is the power of data structure, simple operation can achieve clever functions, really admire the invention of binary heap algorithm people!
214+
215+
Addition, here is an elegant implementation of Heap with python lambda from [vancanhuit](https://github.com/labuladong/fucking-algorithm/issues/157#issue-576237519).

0 commit comments

Comments
 (0)