Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Stack is a container adapter that gives the programmer the functionality of a stack - specifically, a LIFO (last-in, first-out) data structure.
func (*Stack[T]) Empty ¶
Empty checks if the underlying container has no elements. Complexity - constant e.g. O(1). Returns true if the underlying container is empty, false otherwise.
func (*Stack[T]) Pop ¶
func (s *Stack[T]) Pop() T
Pop removes the top element from the Stack. Returns the object at the top of this Stack.
func (*Stack[T]) Push ¶
func (s *Stack[T]) Push(item T)
Push pushes the given element value to the top of the Stack. Complexity - constant e.g. O(1).
Click to show internal directories.
Click to hide internal directories.