Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorExceededCapacity = errors.New("capacity is exceeded") ErrorEmptyStack = errors.New("can't perform pop, peek on empty stack") )
Functions ¶
This section is empty.
Types ¶
type ArrayStack ¶
type ArrayStack struct {
// contains filtered or unexported fields
}
func NewArrayStack ¶
func NewArrayStack(capacity int) *ArrayStack
func (*ArrayStack) IsEmpty ¶
func (s *ArrayStack) IsEmpty() bool
func (*ArrayStack) IsFull ¶
func (s *ArrayStack) IsFull() bool
func (*ArrayStack) Peek ¶
func (s *ArrayStack) Peek() (interface{}, error)
func (*ArrayStack) Pop ¶
func (s *ArrayStack) Pop() (interface{}, error)
func (*ArrayStack) Push ¶
func (s *ArrayStack) Push(element interface{}) error
func (*ArrayStack) Size ¶
func (s *ArrayStack) Size() int
type LinkedListStack ¶
type LinkedListStack struct {
// contains filtered or unexported fields
}
func NewLinkedListStack ¶
func NewLinkedListStack(capacity int) *LinkedListStack
func (*LinkedListStack) IsEmpty ¶
func (s *LinkedListStack) IsEmpty() bool
func (*LinkedListStack) IsFull ¶
func (s *LinkedListStack) IsFull() bool
func (*LinkedListStack) Peek ¶
func (s *LinkedListStack) Peek() (interface{}, error)
func (*LinkedListStack) Pop ¶
func (s *LinkedListStack) Pop() (interface{}, error)
func (*LinkedListStack) Push ¶
func (s *LinkedListStack) Push(element interface{}) error
func (*LinkedListStack) Size ¶
func (s *LinkedListStack) Size() int
Click to show internal directories.
Click to hide internal directories.