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

Method Peek

structure/stack/stacklinkedlist.go:59–61  ·  view source on GitHub ↗

peak return last input value

()

Source from the content-addressed store, hash-verified

57
58// peak return last input value
59func (ll *Stack) Peek() any {
60 return ll.top.Val
61}
62
63// show all value as an interface array
64func (ll *Stack) Show() (in []any) {

Callers 2

TestStackLinkedListFunction · 0.95
TestStackArrayFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestStackLinkedListFunction · 0.76
TestStackArrayFunction · 0.76