Documentation ¶
Overview ¶
Package deque forked from https://github.com/oleiade/lane
Index ¶
- type Deque
- func (s *Deque) Append(item interface{}) bool
- func (s *Deque) Capacity() int
- func (s *Deque) Empty() bool
- func (s *Deque) First() interface{}
- func (s *Deque) Full() bool
- func (s *Deque) IterFirst() *list.Element
- func (s *Deque) IterLast() *list.Element
- func (s *Deque) Last() interface{}
- func (s *Deque) Pop() interface{}
- func (s *Deque) Prepend(item interface{}) bool
- func (s *Deque) Shift() interface{}
- func (s *Deque) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deque ¶
Deque is a head-tail linked list data structure implementation. It is based on a double linked list container, so that every operation's time complexity is O(1).
Every operation and Deque instances are synchronized and safe for concurrent usage.
func (*Deque) Append ¶
Append inserts item at the back of the Deque in a O(1) time complexity, returning true if successful or false if the deque is at max capacity
func (*Deque) First ¶
func (s *Deque) First() interface{}
First returns the first value stored in the Deque in a O(1) time complexity
func (*Deque) Last ¶
func (s *Deque) Last() interface{}
Last returns the last value stored in the Deque in a O(1) time complexity
func (*Deque) Pop ¶
func (s *Deque) Pop() interface{}
Pop removes the last element of the Deque in a O(1) time complexity
func (*Deque) Prepend ¶
Prepend inserts item at the front of the Deque in a O(1) time complexity, returning true if successful or false if the deque is at max capacity