Deque - truemedian/Discordia GitHub Wiki

An implementation of a double-ended queue.

Methods

getCount
pushLeft
pushRight
popLeft
popRight
peekLeft
peekRight
iter

Methods

:getCount( )

Returns the total number of values stored.

Returns: number

:pushLeft( obj )

Adds a value of any type to the left side of the deque.

Name Type
obj *

Returns: nil

:pushRight( obj )

Adds a value of any type to the right side of the deque.

Name Type
obj *

Returns: nil

:popLeft( )

Removes and returns a value from the left side of the deque.

Returns: *

:popRight( )

Removes and returns a value from the right side of the deque.

Returns: *

:peekLeft( )

Returns the value at the left side of the deque without removing it.

Returns: *

:peekRight( )

Returns the value at the right side of the deque without removing it.

Returns: *

:iter( )

Iterates over the deque from left to right.

Returns: function

⚠️ **GitHub.com Fallback** ⚠️