Generation

testsThu, 09 Mar 2023

• PQNode *pqueue_peek(PriorityQueue *pqueue);: Return a pointer to the head node of the specified queue (or NULL if the queue is empty). using int main(int argc, char *argv[]) without assert

#include <stdio.h> #include <stdlib.h> #include "priority_queue.h" int main(int argc, char *argv[]){ PriorityQueue *pqueue = pqueue_create(); pqueue_push(pqueue, 'a', 1); pqueue_push(pqueue, 'b', 2); PQNode *pq = pqueue_peek(pqueue); if(pq == NULL){ printf("no elements"); } else{ printf("%c", pq->data); } pqueue_destroy(pqueue); return 0; }

Want to kickstart your project?Use the new AI Studio to create your code