Documentation
¶
Index ¶
- type Queue
- func (q *Queue[ITEM]) Dequeue() (ITEM, error)
- func (q *Queue[ITEM]) Enqueue(item ITEM) error
- func (q *Queue[ITEM]) Front() (ITEM, error)
- func (q *Queue[ITEM]) IsEmpty() bool
- func (q *Queue[ITEM]) IsFull() bool
- func (q *Queue[ITEM]) Items() []ITEM
- func (q *Queue[ITEM]) WithMax(max int) QueueInterface[ITEM]
- type QueueInterface
- type Set
- type SetInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[ITEM any] struct { // contains filtered or unexported fields }
func (*Queue[ITEM]) WithMax ¶
func (q *Queue[ITEM]) WithMax(max int) QueueInterface[ITEM]
WithMax implements QueueInterface.
type QueueInterface ¶
type QueueInterface[ITEM any] interface { WithMax(max int) QueueInterface[ITEM] Enqueue(item ITEM) error Dequeue() (ITEM, error) IsEmpty() bool IsFull() bool Front() (ITEM, error) Items() []ITEM }
func NewQueue ¶
func NewQueue[ITEM any]() QueueInterface[ITEM]
type Set ¶
type Set[E comparable] struct { Values map[E]bool }
func (*Set[E]) DelIf ¶
func (s *Set[E]) DelIf(condition func(value E) bool) SetInterface[E]
type SetInterface ¶
type SetInterface[E comparable] interface { Add(values ...E) IsExists(value E) bool Del(values ...E) Slice() []E Clear() IsEmpty() bool Size() int DelIf(condition func(value E) bool) SetInterface[E] }
func NewSet ¶
func NewSet[E comparable](values ...E) SetInterface[E]
Set data type is like `slice` or `array` but without duplicate element and set element is unordered element
Click to show internal directories.
Click to hide internal directories.