\mathcal{O}(n).
Modify each element of the queue.
Moduledeque-0.4.4.1Haskell2010
Deque.Strict.State
Strict Deque API lifted to a State monad, "mtl"-style.
- 22 values
- Packagedeque-0.4.4.1
- Exports22
- LanguageHaskell2010
- LicenceMIT
- SourceState.hs
\mathcal{O}(n).
Add elements to the begginning.
\mathcal{O}(n).
Add elements to the ending.
\mathcal{O}(1).
Add element in the beginning.
\mathcal{O}(1).
Add element in the ending.
\mathcal{O}(1).
Reverse the deque.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Move the first element to the end.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Move the last element to the beginning.
\mathcal{O}(n).
Leave only the elements satisfying the predicate.
\mathcal{O}(n).
Leave only the specified amount of first elements.
\mathcal{O}(n).
Drop the specified amount of first elements.
\mathcal{O}(n).
Leave only the first elements satisfying the predicate.
\mathcal{O}(n).
Drop the first elements satisfying the predicate.
\mathcal{O}(n).
Return the first elements satisfying the predicate, removing them from the state.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Get the first element if deque is not empty,
removing the element.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Get the last element if deque is not empty,
removing the element.
\mathcal{O}(1).
Check whether deque is empty.
\mathcal{O}(1).
Check whether deque is empty.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Get the first element if deque is not empty.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Get the last element if deque is not empty.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Keep all elements but the first one.
\mathcal{O}(1), occasionally \mathcal{O}(n).
Keep all elements but the last one.