Documentation
¶
Overview ¶
Package ds implements some basic data structures in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
A Set represents a mathematical set.
The zero value for Set is usable, and represents an empty set. Sets might not work correctly with values which are not comparable in the ordinary way, such as floating point NaNs.
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
A Stack is a simple last-in-first-out collection of items.
func (*Stack[T]) Peek ¶
func (s *Stack[T]) Peek() T
Peek returns the same value as Pop, but does not remove it from the Stack.
Peek panics when called on an empty Stack.
Click to show internal directories.
Click to hide internal directories.