Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparator ¶
type Comparator[T comparable] func(a, b T) int
Comparator will make type assertion (see IntComparator for example), which will panic if a or b are not of the asserted type.
Should return a number:
negative , if a < b zero , if a == b positive , if a > b
type Container ¶
type Container[T comparable] interface { Empty() bool Size() int Clear() Values() []T String() string }
Container is base interface that all data structures implement.
type List ¶
type List[T comparable] interface { Get(index int) (T, bool) Remove(index int) Add(values ...T) Contains(values ...T) bool Sort(comparator Comparator[T]) Swap(index1, index2 int) Insert(index int, values ...T) Set(index int, value T) Container[T] }
List interface that all lists implement
type Map ¶
type Map[K constraints.Ordered, V comparable] interface { Len() int Keys() []K Values() []V Range(func(K, V) bool) Get(K) V GetExist(K) (V, bool) Set(K, V) Del(K) }
Click to show internal directories.
Click to hide internal directories.