Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue represents a FIFO list.
func (*Queue[T]) Dequeue ¶
func (q *Queue[T]) Dequeue() T
Dequeue removes the first element from the queue and returns it (or panics if the queue is empty).
func (*Queue[T]) Enqueue ¶
func (q *Queue[T]) Enqueue(i T)
Enqueue adds another elements to the end of the queue.
type Stack ¶
type Stack[T any] []T
Stack represents a LIFO list.
func (*Stack[T]) Peek ¶
func (s *Stack[T]) Peek() T
Peek returns the last element of the stack (or panics if the stack is empty).
func (*Stack[T]) Pop ¶
func (s *Stack[T]) Pop() T
Pop removes the last element of the stack and returns it (or panics if the stack is empty).
Click to show internal directories.
Click to hide internal directories.