Naman-Bhalla / py_min_queue

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

About

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

License:Apache License 2.0


Languages

Language:Python 100.0%