Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/0xAX/go-algorithms
/ New
Function
New
stack/stack.go:15–20 ·
view source on GitHub ↗
Initialzes new Stack
()
Source
from the content-addressed store, hash-verified
13
14
// Initialzes new Stack
15
func
New() *Stack {
16
var
stack *Stack = new(Stack)
17
18
stack.depth = 0
19
return
stack
20
}
21
22
// Pushes a given item into Stack
23
func
(stack *Stack) Push(item
interface
{}) {
Callers
1
TestStack
Function · 0.70
Calls
no outgoing calls
Tested by
1
TestStack
Function · 0.56