Documentation
¶
Overview ¶
Package stack asks the student to implement a stack in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a stack of data.
func Make ¶
Make allows the creation of a stack with an initial capacity for efficiency. Otherwise a stack can be used in its zero value state.
func (*Stack) Operate ¶
Operate accepts a function that takes data and calls the specified function for every piece of data found. It traverses from the top down through the stack.
func (*Stack) Peek ¶
Peek provides the data stored on the stack based on the level from the bottom. A value of 0 would return the top piece of data.
Click to show internal directories.
Click to hide internal directories.