Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Go
/ Length
Method
Length
structure/stack/stacklinkedlist.go:54–56 ·
view source on GitHub ↗
len use to return length of our stack
()
Source
from the content-addressed store, hash-verified
52
53
// len use to return length of our stack
54
func
(ll *Stack) Length() int {
55
return
ll.length
56
}
57
58
// peak return last input value
59
func
(ll *Stack) Peek() 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