Questions tagged [priority-queue]

Priority queues are dynamic sets that always remove highest priority elements first.

Filter by
Sorted by
Tagged with
1
vote
2answers
298 views

Fibonacci heap in C - follow-up

(See the previous iteration.) I have incorporated some points made by ChrisWue and refactored my Fibonacci heap implementation: fibonacci_heap.h ...
5
votes
3answers
2k views

Indexed Fibonacci heap implementation

I implemented two versions of a Fibonacci heap one using a unordered map (mapping keys to their nodes) so that the client can call decrease in \$O(1)\$ average and ...
4
votes
2answers
3k views

Maximum Priority Queue using Heap

I have written this program for Maximim Priority Queue after studying from Introduction to Algorithm . I want to improve my code. Is there any other method to implement Priority Queue instead of Heap? ...
11
votes
1answer
93 views

Longest lines using priority queue

Inspired by a comment on this question, I thought I'd exercise my C skills by implementing something like it using a priority queue. The idea is to be able to invoke the program like this: ./...
4
votes
4answers
2k views

Priority queue implementation in C based on heap ordered (resizable) array

I am practicing writing C library code and wrote a priority queue for some graph work. I am fairly new to writing C libraries so would appreciate any feedback on this implementation. Some items to ...
4
votes
1answer
2k views

Fibonacci heap in C

(See the next iteration.) I have rewritten a Fibonacci heap implementation from Java to C. fibonacci_heap.h: ...
2
votes
0answers
61 views

A Priority Queue implemented using a Linked List

I'm going to write a Huffman Coding implementation, and decided to write from scratch a priority queue to help out. I've never written a priority queue before, in any language, so this was interesting....
2
votes
1answer
1k views

Priority queue implementation using unsorted and sorted array

Below is the unsorted array and sorted array implementation of priority queue. Code directory structure: ...
1
vote
1answer
125 views

Dijkstra's Algorithm not optimized enough

I was attempting a question on HackerRank-Dijkstra's Shortest Reach 2 and upon submission my programs times out in 3/7 test cases. One of the test cases had 200 nodes and about 2000 connections. Here ...