package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=9b654edb663ae697563f150824047052f3b1bf760398f24bce6350553f031f73c46b6337239a1acd871e61238597ea92046809e3358290ff14d6ba671b449085
doc/orsetto.cf/Cf_deque/A/index.html
Module Cf_deque.A
Operations on the left end of a deque.
push x d
adds the element x
to the end of the deque d
. The average cost is constant. Worst-case running time is O(log N), which happens once in every N operations.
pop q
returns None
if q
is the empty deque, otherwise it returns Some (x, d')
where x
is the element on the end of the deque, and q'
is the remainder of q
with the element x
removed. The average cost is constant. Worst-case running time is O(log N), which happens once in every N operations.
val head : 'a t -> 'a
head q
returns the element at the end of the deque q
. Raises Not_found
if the deque is empty.
tail q
is discards the element at the end of the deque q
. Raises Not_found
if the deque is empty.
Use of_seq s
to make a deque by consuming all the elements in the sequence s
. The head of the deque is the first element consumed and the tail is the final element consumed.