summaryrefslogtreecommitdiffhomepage
path: root/examples/priority.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-09-02 19:49:51 +0200
committerTyge Løvset <[email protected]>2020-09-02 19:49:51 +0200
commitaf12926547b1a09b4513ba149d13ea9f84d4c528 (patch)
tree954ab763d10a2c5558163645004b9c11ed63b5d1 /examples/priority.c
parent1b46028f4636c78af40c37dbc55d76598996a5b7 (diff)
downloadSTC-modified-af12926547b1a09b4513ba149d13ea9f84d4c528.tar.gz
STC-modified-af12926547b1a09b4513ba149d13ea9f84d4c528.zip
Added cqueue.h and cstack.h adapters. Updated cpqueue.h API to be more consistent.
Diffstat (limited to 'examples/priority.c')
-rw-r--r--examples/priority.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/priority.c b/examples/priority.c
index 0204779d..82e78621 100644
--- a/examples/priority.c
+++ b/examples/priority.c
@@ -7,7 +7,7 @@
#include <stc/crandom.h>
declare_cvec(i, int64_t);
-declare_cpqueue(i, >, cvec); // min-heap (increasing values)
+declare_cpqueue(i, cvec_i, >); // min-heap (increasing values)
int main() {
size_t N = 10000000;
@@ -28,7 +28,7 @@ int main() {
// Extract the hundred smallest.
for (int i=0; i<100; ++i) {
- printf("%zd ", cpqueue_i_top(heap));
+ printf("%zd ", *cpqueue_i_top(&heap));
cpqueue_i_pop(&heap);
}
cpqueue_i_destroy(&heap);