Skip to content

Sample implementation of a priority queue using a binary heap.

Notifications You must be signed in to change notification settings

hashtaggigs/priority-queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

priority-queue

Sample implementation of a priority queue using a binary heap.

Rules followed:

  1. The queue must have an insert method which takes a number.
  2. If the number is not already present in the queue, it is added to the queue with a priority equal to the number.
  3. If the number is present, it's priority is increased by one.
  4. The queue must have a remove method which does not take any arguments, and removes and returns the number with the highest priority.
  5. The insert and remove functions should run in O(lg n)
  6. Assume that all inputs are safe.
  7. Don't pull in any external libraries.

TODO: Add documentation and lintify it.

- Created by Aaron C. Schafer on 8/30/2016.

About

Sample implementation of a priority queue using a binary heap.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published