[priority-heap] Comment

This commit is contained in:
Behdad Esfahbod 2023-04-22 10:16:43 -06:00
parent 48f8ed7e02
commit 8e43e3a8ce
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@
* *
* Priority queue implemented as a binary heap. Supports extract minimum * Priority queue implemented as a binary heap. Supports extract minimum
* and insert operations. * and insert operations.
*
* The priority queue is implemented as a binary heap, which is a complete
* binary tree. The root of the tree is the minimum element. The heap
* property is that the priority of a node is less than or equal to the
* priority of its children. The heap is stored in an array, with the
* children of node i stored at indices 2i + 1 and 2i + 2.
*/ */
struct hb_priority_queue_t struct hb_priority_queue_t
{ {