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

Method EnqueueFront

structure/deque/deque.go:27–29  ·  view source on GitHub ↗

EnqueueFront adds an item at the front of Deque.

(item T)

Source from the content-addressed store, hash-verified

25
26// EnqueueFront adds an item at the front of Deque.
27func (dq *DoublyEndedQueue[T]) EnqueueFront(item T) {
28 dq.deque = append([]T{item}, dq.deque...)
29}
30
31// EnqueueRear adds an item at the rear of Deque.
32func (dq *DoublyEndedQueue[T]) EnqueueRear(item T) {

Callers 1

TestDequeFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestDequeFunction · 0.64