Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 401 Bytes

File metadata and controls

7 lines (4 loc) · 401 Bytes

PriorityQueue

The Priority Queue is implemented using a Max Heap data structure organized in a python list. When the priority of the incoming commands are the same, the timestamps are used as a tiebreaker for determining the final priority.

The enqueue and dequeue processes each take O(log n) time.

The code was implemented in Python 3 and includes unit tests to test success and failure cases.