From 8e43e3a8ce72a3888e9bfbc9f2975fc56e139836 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 22 Apr 2023 10:16:43 -0600 Subject: [PATCH] [priority-heap] Comment --- src/hb-priority-queue.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-priority-queue.hh b/src/hb-priority-queue.hh index 93a7842eb..bf1b282d3 100644 --- a/src/hb-priority-queue.hh +++ b/src/hb-priority-queue.hh @@ -35,6 +35,12 @@ * * Priority queue implemented as a binary heap. Supports extract minimum * 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 {