]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
prioq: add introduction comment 1403/head
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 29 Sep 2015 10:48:14 +0000 (12:48 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 29 Sep 2015 10:49:25 +0000 (12:49 +0200)
Add comment to prioq.c explaining what it does. And more importantly,
mention that we implement a Heap. It's more than annoying having to
figure out what the code actually does, without ever mentioning the word
'heap'.

src/basic/prioq.c

index b89888be0e8d5460313ffc3e9712856f214ce5d2..69ec45d97e067e0d517198530dd1e28b81bc550e 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+/*
+ * Priority Queue
+ * The prioq object implements a priority queue. That is, it orders objects by
+ * their priority and allows O(1) access to the object with the highest
+ * priority. Insertion and removal are Θ(log n). Optionally, the caller can
+ * provide a pointer to an index which will be kept up-to-date by the prioq.
+ *
+ * The underlying algorithm used in this implementation is a Heap.
+ */
+
 #include "util.h"
 #include "prioq.h"