Documentation ¶
Index ¶
- Constants
- type ArrayRing
- type ArrayStack
- func (s *ArrayStack[T]) Cap() int
- func (s *ArrayStack[T]) Clear()
- func (s *ArrayStack[T]) Empty() bool
- func (s *ArrayStack[T]) Full() bool
- func (s *ArrayStack[T]) Iter() []T
- func (s *ArrayStack[T]) Len() int
- func (s *ArrayStack[T]) Pop() error
- func (s *ArrayStack[T]) Push(v T) error
- func (s *ArrayStack[T]) Top() (T, error)
- type Bitmap
- type BloomFilter
- type DelayQueue
- type Deque
- type DoubleLinkedList
- type HashMap
- type Heap
- type Iterator
- type LinkedHashMap
- type ListDeque
- type ListNode
- type ListQueue
- type ListRing
- type ListStack
- type MapTrie
- func (t *MapTrie[T]) Delete(word string)
- func (t *MapTrie[T]) Find(word string) T
- func (t *MapTrie[T]) FindChildren(word string) (ret []string)
- func (t *MapTrie[T]) FindNode(word string) (Trie[T], bool)
- func (t *MapTrie[T]) Insert(word string, v T) error
- func (t *MapTrie[T]) Keys() []string
- func (t *MapTrie[T]) Search(word string) bool
- func (t *MapTrie[T]) StartsWith(prefix string) bool
- func (t *MapTrie[T]) Value() T
- type Queue
- type SliceHeap
- type Stack
- type Trie
- type Vector
- func (vec *Vector[T]) Back() ListNode[T]
- func (vec *Vector[T]) Find(n int) ListNode[T]
- func (vec *Vector[T]) Front() ListNode[T]
- func (vec *Vector[T]) PopBack() ListNode[T]
- func (vec *Vector[T]) PopFront() ListNode[T]
- func (vec *Vector[T]) PushBack(v T) ListNode[T]
- func (vec *Vector[T]) PushFront(v T) ListNode[T]
- func (vec *Vector[T]) Remove(node ListNode[T])
- func (vec *Vector[T]) Size() int
- type VectorNode
- type WordTrie
- func (t *WordTrie[T]) Delete(word string)
- func (t *WordTrie[T]) Find(word string) T
- func (t *WordTrie[T]) FindChildren(word string) []string
- func (t *WordTrie[T]) FindNode(word string) (Trie[T], bool)
- func (t *WordTrie[T]) Insert(word string, v T) error
- func (t *WordTrie[T]) Keys() []string
- func (t *WordTrie[T]) Search(word string) bool
- func (t *WordTrie[T]) StartsWith(prefix string) bool
- func (t *WordTrie[T]) Value() T
Constants ¶
View Source
const ( HeapMax = true HeapMin = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayStack ¶
type ArrayStack[T any] struct { // contains filtered or unexported fields }
func NewStack ¶
func NewStack[T any](cap int) *ArrayStack[T]
func (*ArrayStack[T]) Cap ¶
func (s *ArrayStack[T]) Cap() int
func (*ArrayStack[T]) Clear ¶
func (s *ArrayStack[T]) Clear()
func (*ArrayStack[T]) Empty ¶
func (s *ArrayStack[T]) Empty() bool
func (*ArrayStack[T]) Full ¶
func (s *ArrayStack[T]) Full() bool
func (*ArrayStack[T]) Iter ¶
func (s *ArrayStack[T]) Iter() []T
func (*ArrayStack[T]) Len ¶
func (s *ArrayStack[T]) Len() int
func (*ArrayStack[T]) Pop ¶
func (s *ArrayStack[T]) Pop() error
func (*ArrayStack[T]) Push ¶
func (s *ArrayStack[T]) Push(v T) error
func (*ArrayStack[T]) Top ¶
func (s *ArrayStack[T]) Top() (T, error)
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
func NewBloomFilter ¶
func NewBloomFilter(size, round int) *BloomFilter
func (*BloomFilter) Check ¶
func (filter *BloomFilter) Check(v string) bool
func (*BloomFilter) Set ¶
func (filter *BloomFilter) Set(v string)
type DelayQueue ¶
type DelayQueue[T any] struct { // contains filtered or unexported fields }
func NewDelayQueue ¶
func NewDelayQueue[T any]() *DelayQueue[T]
func (*DelayQueue[T]) Channel ¶
func (queue *DelayQueue[T]) Channel(ctx context.Context, size int) <-chan T
func (*DelayQueue[T]) Push ¶
func (queue *DelayQueue[T]) Push(value T, delay time.Duration)
type Deque ¶
type Deque[T any] interface { Queue[T] Back() (T, bool) EnqueueFront(v T) error DequeueBack() error }
func NewListDeque ¶
type DoubleLinkedList ¶
type HashMap ¶
type HashMap[R util.Comparable, T any] interface { Put(k R, v T) Get(k R) (T, bool) Del(k R) }
type LinkedHashMap ¶
type LinkedHashMap[R util.Comparable, T any] struct { // contains filtered or unexported fields }
func NewLinkedHashMap ¶
func NewLinkedHashMap[R util.Comparable, T any](hash func(key R, cap int) R) *LinkedHashMap[R, T]
func (*LinkedHashMap[R, T]) Del ¶
func (h *LinkedHashMap[R, T]) Del(k R)
func (*LinkedHashMap[R, T]) Get ¶
func (h *LinkedHashMap[R, T]) Get(k R) (T, bool)
func (*LinkedHashMap[R, T]) Iter ¶
func (h *LinkedHashMap[R, T]) Iter() DoubleLinkedList[T]
func (*LinkedHashMap[R, T]) Put ¶
func (h *LinkedHashMap[R, T]) Put(k R, v T)
type ListRing ¶
type ListRing[T any] struct { // contains filtered or unexported fields }
func NewListRing ¶
type ListStack ¶
type ListStack[T any] struct { // contains filtered or unexported fields }
func NewListStack ¶
type MapTrie ¶
type MapTrie[T any] struct { // contains filtered or unexported fields }
func (*MapTrie[T]) FindChildren ¶
func (*MapTrie[T]) StartsWith ¶
type Queue ¶
type Queue[T any] interface { Cap() int Enqueue(v T) error Dequeue() error Front() (T, bool) Full() bool Empty() bool }
func NewArrayRing ¶
func NewListQueue ¶
type VectorNode ¶
type VectorNode[T any] struct { // contains filtered or unexported fields }
func (*VectorNode[T]) Next ¶
func (node *VectorNode[T]) Next() ListNode[T]
func (*VectorNode[T]) Prev ¶
func (node *VectorNode[T]) Prev() ListNode[T]
func (*VectorNode[T]) Value ¶
func (node *VectorNode[T]) Value() T
type WordTrie ¶
type WordTrie[T any] struct { // contains filtered or unexported fields }
func WordTrieOf ¶
func (*WordTrie[T]) FindChildren ¶
func (*WordTrie[T]) StartsWith ¶
Click to show internal directories.
Click to hide internal directories.