/py_min_queue

An Implementation of a Queue with O(1) find-min

Primary LanguagePythonApache License 2.0Apache-2.0

py_min_queue

Python implementation of a Queue that supports find_min() alongwith usual queue operations.

The time and space complexities of find_min() are as follows:

  • O(1) Time
  • O(1) Space (For Integers), O(n) Space (Generalized) [n = size of stack]

Enqueue, Deque are O(1) time as usual.

Motivation

Came across a problem while solving a Competitive Programming question and came to know about this particular data structure.

Implementation Details

For details regarding implementation, and how it works, please check the following links: