import "github.com/djworth/algos/stack"
type Stack interface {
// Push puts an item on the top of the stack
Push(item interface{})
// Pop removes an item from the top of the stack
Pop() interface{}
// Peek looks at the item at the top of the stack but does not remove the item
Peek() interface{}
// Empty returns if the stack has items or not
Empty() bool
}
Stack interface supporting the normal stack functions. The implementation uses a linked list
func New() Stack
import "github.com/djworth/algos/queue"
func New() Queue
type Queue interface {
// Add puts an item on the queue
Add(item interface{})
// Remove takes the first time off of the queue
Remove() interface{}
// Peek returns the first on the queue
Peek() interface{}
// Empty returns true or false if the queue contains values
Empty() bool
}
Queue is the interface of a queue implementation using two stacks
Generated by godoc2md