Documentation ¶
Index ¶
- Constants
- type AnimalNode
- type LengthAwareStack
- type MinAwareStack
- type MultiArrayStack
- func (stack *MultiArrayStack) AssertStackIndexIsWithinRange(stackIndex int)
- func (stack *MultiArrayStack) IsEmpty(stackIndex int) bool
- func (stack *MultiArrayStack) Peek(stackIndex int, data int) (int, error)
- func (stack *MultiArrayStack) Pop(stackIndex int) (int, error)
- func (stack *MultiArrayStack) Push(stackIndex int, data int) error
- type MultiDimensionalStack
- func (stack *MultiDimensionalStack) IsEmpty() bool
- func (stack *MultiDimensionalStack) Peek() (int, error)
- func (stack *MultiDimensionalStack) Pop() (int, error)
- func (stack *MultiDimensionalStack) PopAt(index int) (int, error)
- func (stack *MultiDimensionalStack) Print() string
- func (stack *MultiDimensionalStack) Push(data int)
- type NodeStack
- type Queue
- type QueueNode
- type QueueUsingStacks
- type Shelter
- type Stack
- type StackNode
Constants ¶
View Source
const TypeCat = "CAT"
View Source
const TypeDog = "DOG"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnimalNode ¶
type LengthAwareStack ¶
type LengthAwareStack struct {
// contains filtered or unexported fields
}
type MinAwareStack ¶
type MinAwareStack struct {
// contains filtered or unexported fields
}
func (*MinAwareStack) IsEmpty ¶
func (stack *MinAwareStack) IsEmpty() bool
func (*MinAwareStack) Min ¶
func (stack *MinAwareStack) Min() (int, error)
func (*MinAwareStack) Peek ¶
func (stack *MinAwareStack) Peek() (int, error)
func (*MinAwareStack) Pop ¶
func (stack *MinAwareStack) Pop() (int, error)
func (*MinAwareStack) Push ¶
func (stack *MinAwareStack) Push(data int)
type MultiArrayStack ¶
type MultiArrayStack struct {
// contains filtered or unexported fields
}
We assume the 3 stacks of length = 4 each
func NewMultiArrayStack ¶
func NewMultiArrayStack() *MultiArrayStack
func (*MultiArrayStack) AssertStackIndexIsWithinRange ¶
func (stack *MultiArrayStack) AssertStackIndexIsWithinRange(stackIndex int)
func (*MultiArrayStack) IsEmpty ¶
func (stack *MultiArrayStack) IsEmpty(stackIndex int) bool
type MultiDimensionalStack ¶
type MultiDimensionalStack struct {
// contains filtered or unexported fields
}
func (*MultiDimensionalStack) IsEmpty ¶
func (stack *MultiDimensionalStack) IsEmpty() bool
func (*MultiDimensionalStack) Peek ¶
func (stack *MultiDimensionalStack) Peek() (int, error)
func (*MultiDimensionalStack) Pop ¶
func (stack *MultiDimensionalStack) Pop() (int, error)
func (*MultiDimensionalStack) PopAt ¶
func (stack *MultiDimensionalStack) PopAt(index int) (int, error)
func (*MultiDimensionalStack) Print ¶
func (stack *MultiDimensionalStack) Print() string
func (*MultiDimensionalStack) Push ¶
func (stack *MultiDimensionalStack) Push(data int)
type QueueUsingStacks ¶
type QueueUsingStacks struct {
// contains filtered or unexported fields
}
func (*QueueUsingStacks) Add ¶
func (queue *QueueUsingStacks) Add(data int)
func (*QueueUsingStacks) IsEmpty ¶
func (queue *QueueUsingStacks) IsEmpty() bool
func (*QueueUsingStacks) Peek ¶
func (queue *QueueUsingStacks) Peek() (int, error)
func (*QueueUsingStacks) Remove ¶
func (queue *QueueUsingStacks) Remove() (int, error)
type Shelter ¶
func GetNewShelter ¶
func GetNewShelter() *Shelter
func (*Shelter) DequeueAny ¶
func (shelter *Shelter) DequeueAny() (AnimalNode, error)
func (*Shelter) DequeueCat ¶
func (shelter *Shelter) DequeueCat() (AnimalNode, error)
func (*Shelter) DequeueDog ¶
func (shelter *Shelter) DequeueDog() (AnimalNode, error)
func (*Shelter) Enqueue ¶
func (shelter *Shelter) Enqueue(node AnimalNode)
Click to show internal directories.
Click to hide internal directories.