MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Front

Method Front

structure/queue/queuelinklistwithlist.go:43–50  ·  view source on GitHub ↗

Front it will return the front value

()

Source from the content-addressed store, hash-verified

41
42// Front it will return the front value
43func (lq *LQueue) Front() (any, error) {
44 if !lq.Empty() {
45 val := lq.queue.Front().Value
46 return val, nil
47 }
48
49 return "", fmt.Errorf("error queue is empty")
50}
51
52// Back it will return the back value
53func (lq *LQueue) Back() (any, error) {

Callers 2

TestQueueFunction · 0.95
DequeueMethod · 0.45

Calls 1

EmptyMethod · 0.95

Tested by 1

TestQueueFunction · 0.76