queue

package
v0.0.0-...-e6a591c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element[T any] struct {

	// The value stored with this element.
	Value T
	// contains filtered or unexported fields
}

func (*Element[T]) Next

func (e *Element[T]) Next() *Element[T]

func (*Element[T]) Prev

func (e *Element[T]) Prev() *Element[T]

type List

type List[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any]() *List[T]

func NewList

func NewList[T any]() *List[T]

func (*List[T]) Back

func (l *List[T]) Back() *Element[T]

func (*List[T]) Front

func (l *List[T]) Front() *Element[T]

func (*List[T]) Init

func (l *List[T]) Init() *List[T]

func (*List[T]) InsertAfter

func (l *List[T]) InsertAfter(v T, mark *Element[T]) *Element[T]

InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*List[T]) InsertBefore

func (l *List[T]) InsertBefore(v T, mark *Element[T]) *Element[T]

InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*List[T]) Iter

func (l *List[T]) Iter() iter.Seq[T]

func (*List[T]) Len

func (l *List[T]) Len() int

func (*List[T]) MoveAfter

func (l *List[T]) MoveAfter(e, mark *Element[T])

MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*List[T]) MoveBefore

func (l *List[T]) MoveBefore(e, mark *Element[T])

MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*List[T]) MoveToBack

func (l *List[T]) MoveToBack(e *Element[T])

MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*List[T]) MoveToFront

func (l *List[T]) MoveToFront(e *Element[T])

MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*List[T]) PushBack

func (l *List[T]) PushBack(v T) *Element[T]

PushBack inserts a new element e with value v at the back of list l and returns e.

func (*List[T]) PushBackList

func (l *List[T]) PushBackList(other *List[T])

PushBackList inserts a copy of another list at the back of list l. The lists l and other may be the same. They must not be nil.

func (*List[T]) PushFront

func (l *List[T]) PushFront(v T) *Element[T]

PushFront inserts a new element e with value v at the front of list l and returns e.

func (*List[T]) PushFrontList

func (l *List[T]) PushFrontList(other *List[T])

PushFrontList inserts a copy of another list at the front of list l. The lists l and other may be the same. They must not be nil.

func (*List[T]) Remove

func (l *List[T]) Remove(e *Element[T]) T

Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.

func (*List[T]) RevIter

func (l *List[T]) RevIter() iter.Seq[T]

type ListQueue

type ListQueue[T any] struct {
	// contains filtered or unexported fields
}

func (*ListQueue[T]) Empty

func (q *ListQueue[T]) Empty() bool

func (*ListQueue[T]) Init

func (q *ListQueue[T]) Init()

func (*ListQueue[T]) Iter

func (q *ListQueue[T]) Iter() iter.Seq[T]

func (*ListQueue[T]) Len

func (q *ListQueue[T]) Len() int

func (*ListQueue[T]) Pop

func (q *ListQueue[T]) Pop() (T, bool)

func (*ListQueue[T]) PopBack

func (q *ListQueue[T]) PopBack() T

func (*ListQueue[T]) Push

func (q *ListQueue[T]) Push(v T)

func (*ListQueue[T]) PushBack

func (q *ListQueue[T]) PushBack(v T)

func (*ListQueue[T]) Reset

func (q *ListQueue[T]) Reset()

func (*ListQueue[T]) RevIter

func (q *ListQueue[T]) RevIter() iter.Seq[T]

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func (*Queue[T]) Empty

func (q *Queue[T]) Empty() bool

func (*Queue[T]) Init

func (q *Queue[T]) Init()

func (*Queue[T]) Iter

func (q *Queue[T]) Iter() iter.Seq[T]

func (*Queue[T]) Len

func (q *Queue[T]) Len() int

func (*Queue[T]) Pop

func (q *Queue[T]) Pop() (T, bool)

func (*Queue[T]) Push

func (q *Queue[T]) Push(v T)

func (*Queue[T]) PushBack

func (q *Queue[T]) PushBack(v T)

func (*Queue[T]) PushFront

func (q *Queue[T]) PushFront(v T)

func (*Queue[T]) Reset

func (q *Queue[T]) Reset()

type QueueElem

type QueueElem[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL