Documentation
¶
Index ¶
- type Fifo
- type Filo
- type List
- type Queue
- type Set
- type Stack
- func (s *Stack[T]) Back() T
- func (s *Stack[T]) Cap() int
- func (s *Stack[T]) Find(fn func(T) bool) int
- func (s *Stack[T]) IterRange(src, dst int, fn func(T) bool)
- func (s *Stack[T]) Iterate(popOrd bool, fn func(T) bool)
- func (s *Stack[T]) Peek() T
- func (s *Stack[T]) PeekAt(i int) T
- func (s *Stack[T]) PopBack()
- func (s *Stack[T]) PushBack(e T)
- func (s *Stack[T]) Reverse()
- func (s *Stack[T]) Size() int
- func (s *Stack[T]) String() string
- func (s *Stack[T]) ToSlice() []T
- type StackCmp
- type UnionFind
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Example ¶
testTimes := 100 s := NewStack[int](10) for i := 0; i < testTimes; i++ { s.PushBack(i) } for i := 0; i < testTimes; i++ { e := s.Back() s.PopBack() fmt.Print(e, " ") }
func NewStackFrom ¶ added in v0.1.3
type StackCmp ¶
type StackCmp[T comparable] struct { Stack[T] }
func NewStackCmp ¶
func NewStackCmp[T comparable](c int) *StackCmp[T]
type UnionFind ¶
type UnionFind struct {
// contains filtered or unexported fields
}
func NewUnionFind ¶
func (*UnionFind) IsConnected ¶
func (*UnionFind) NumConnectedComponent ¶
Click to show internal directories.
Click to hide internal directories.