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

Method Back

structure/queue/queuelinklistwithlist.go:53–60  ·  view source on GitHub ↗

Back it will return the back value

()

Source from the content-addressed store, hash-verified

51
52// Back it will return the back value
53func (lq *LQueue) Back() (any, error) {
54 if !lq.Empty() {
55 val := lq.queue.Back().Value
56 return val, nil
57 }
58
59 return "", fmt.Errorf("error queue is empty")
60}
61
62// Len it will return the length of list
63func (lq *LQueue) Len() int {

Callers 1

TestQueueFunction · 0.95

Calls 1

EmptyMethod · 0.95

Tested by 1

TestQueueFunction · 0.76