MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / New

Function New

structure/deque/deque.go:22–24  ·  view source on GitHub ↗

New returns a new DoublyEndedQueue.

()

Source from the content-addressed store, hash-verified

20
21// New returns a new DoublyEndedQueue.
22func New[T any]() *DoublyEndedQueue[T] {
23 return &DoublyEndedQueue[T]{deque: make([]T, 0)}
24}
25
26// EnqueueFront adds an item at the front of Deque.
27func (dq *DoublyEndedQueue[T]) EnqueueFront(item T) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected