Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
59
func
(ll *Stack) Peek() any {
60
return
ll.top.Val
61
}
62
63
// show all value as an interface array
64
func
(ll *Stack) Show() (in []any) {
Callers
2
TestStackLinkedList
Function · 0.95
TestStackArray
Function · 0.95
Calls
no outgoing calls
Tested by
2
TestStackLinkedList
Function · 0.76
TestStackArray
Function · 0.76