Documentation ¶
Overview ¶
Copyright 2009 The Go Authors. All rights reserved. c++ stl style list<> container ,written by andrew.zhang in 2018.10
Index ¶
- type Arg
- type IntFun
- type IterLst
- type List
- func (l *List[V]) Begin() *IterLst[V]
- func (l *List[V]) Clear()
- func (l *List[V]) Empty() bool
- func (l *List[V]) End() *IterLst[V]
- func (l *List[V]) Erase(e *IterLst[V]) V
- func (l *List[V]) Init() *List[V]
- func (l *List[V]) InsertAfter(v V, mark *IterLst[V]) *IterLst[V]
- func (l *List[V]) InsertBefore(v V, mark *IterLst[V]) *IterLst[V]
- func (l *List[V]) Len() int
- func (l *List[V]) MoveAfter(e, mark *IterLst[V])
- func (l *List[V]) MoveBefore(e, mark *IterLst[V])
- func (l *List[V]) MoveToBack(e *IterLst[V])
- func (l *List[V]) MoveToFront(e *IterLst[V])
- func (l *List[V]) PushBack(v V) *IterLst[V]
- func (l *List[V]) PushBackList(other *List[V])
- func (l *List[V]) PushFront(v V) *IterLst[V]
- func (l *List[V]) PushFrontList(other *List[V])
- func (l *List[V]) RBegin() *IterLst[V]
- func (l *List[V]) REnd() *IterLst[V]
- type ListIntFun
- type RBtrIstr
- type RBtrStr
- type RBtree
- func (this *RBtree[K, V]) Append(begin, end RBtreeIter[K, V], deep int, iterfunc func(newit RBtreeIter[K, V]))
- func (this *RBtree[K, V]) Begin() RBtreeIter[K, V]
- func (this *RBtree[K, V]) Between1(key1, key2 K) (lower, upper RBtreeIter[K, V])
- func (this *RBtree[K, V]) Between2(key1, key2 K) (lower, upper RBtreeIter[K, V])
- func (this *RBtree[K, V]) Between3(key1, key2 K) (lower, upper RBtreeIter[K, V])
- func (this *RBtree[K, V]) Between4(key1, key2 K) (lower, upper RBtreeIter[K, V])
- func (this *RBtree[K, V]) Clear(deep int)
- func (this *RBtree[K, V]) Duplicate(deep int) any
- func (this *RBtree[K, V]) Empty() bool
- func (this *RBtree[K, V]) End() RBtreeIter[K, V]
- func (this *RBtree[K, V]) EqualBound(key K) (lower, upper RBtreeIter[K, V])
- func (this *RBtree[K, V]) Erase(it RBtreeIter[K, V])
- func (this *RBtree[K, V]) Find(key K) RBtreeIter[K, V]
- func (this *RBtree[K, V]) GetCompFunc() func(key1, key2 K) int
- func (this *RBtree[K, V]) Index(key K) (val RBtreeIter[K, V], found bool)
- func (this *RBtree[K, V]) Insert(key K, value V) (sucs bool, it RBtreeIter[K, V])
- func (this *RBtree[K, V]) IsAmong(key K) (found bool)
- func (this *RBtree[K, V]) LeftIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
- func (this *RBtree[K, V]) Len() int
- func (this *RBtree[K, V]) LowerBound(key K) RBtreeIter[K, V]
- func (this *RBtree[K, V]) MidIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
- func (this *RBtree[K, V]) Move(_Right RBtree[K, V])
- func (this *RBtree[K, V]) RBegin() RBtreeIter[K, V]
- func (this *RBtree[K, V]) REnd() RBtreeIter[K, V]
- func (this *RBtree[K, V]) Remove(key K) int
- func (this *RBtree[K, V]) RightIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
- func (this *RBtree[K, V]) Size() int
- func (this *RBtree[K, V]) String() string
- func (this *RBtree[K, V]) UpperBound(key K) RBtreeIter[K, V]
- type RBtreeIter
- type RBtreeKn
- type RBtreeRkn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntFun ¶
type IntFun struct {
// contains filtered or unexported fields
}
---------------------------------------
type IterLst ¶
type IterLst[V any] struct { // contains filtered or unexported fields }
IterLst is an element of a linked list.
type List ¶
type List[V any] struct { // contains filtered or unexported fields }
List represents a doubly linked list. The zero value for List is an empty list ready to use.
func (*List[V]) Erase ¶
Remove removes e from l if e is an element of list l. It returns the element value e.value.
func (*List[V]) InsertAfter ¶
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified.
func (*List[V]) InsertBefore ¶
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified.
func (*List[V]) MoveAfter ¶
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified.
func (*List[V]) MoveBefore ¶
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified.
func (*List[V]) MoveToBack ¶
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified.
func (*List[V]) MoveToFront ¶
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified.
func (*List[V]) PushBack ¶
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*List[V]) PushBackList ¶
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same.
func (*List[V]) PushFront ¶
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*List[V]) PushFrontList ¶
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same.
type ListIntFun ¶
type RBtrIstr ¶
----------------------------------------------------------- class RBtrIstr
RBtrIstr Key字符串不区分大小写
type RBtree ¶
type RBtree[K, V any] struct { // contains filtered or unexported fields }
func (*RBtree[K, V]) Append ¶
func (this *RBtree[K, V]) Append(begin, end RBtreeIter[K, V], deep int, iterfunc func(newit RBtreeIter[K, V]))
func (*RBtree[K, V]) Begin ¶
func (this *RBtree[K, V]) Begin() RBtreeIter[K, V]
func (*RBtree[K, V]) Between1 ¶
func (this *RBtree[K, V]) Between1(key1, key2 K) (lower, upper RBtreeIter[K, V])
Between1 return x>=key1 && x<key2
func (*RBtree[K, V]) Between2 ¶
func (this *RBtree[K, V]) Between2(key1, key2 K) (lower, upper RBtreeIter[K, V])
Between2 return x>=key1 && x<=key2
func (*RBtree[K, V]) Between3 ¶
func (this *RBtree[K, V]) Between3(key1, key2 K) (lower, upper RBtreeIter[K, V])
Between3 return x>key1 && x<key2
func (*RBtree[K, V]) Between4 ¶
func (this *RBtree[K, V]) Between4(key1, key2 K) (lower, upper RBtreeIter[K, V])
return x>key1 && x<=key2
func (*RBtree[K, V]) End ¶
func (this *RBtree[K, V]) End() RBtreeIter[K, V]
func (*RBtree[K, V]) EqualBound ¶
func (this *RBtree[K, V]) EqualBound(key K) (lower, upper RBtreeIter[K, V])
func (*RBtree[K, V]) Erase ¶
func (this *RBtree[K, V]) Erase(it RBtreeIter[K, V])
func (*RBtree[K, V]) Find ¶
func (this *RBtree[K, V]) Find(key K) RBtreeIter[K, V]
func (*RBtree[K, V]) GetCompFunc ¶
func (*RBtree[K, V]) Index ¶
func (this *RBtree[K, V]) Index(key K) (val RBtreeIter[K, V], found bool)
func (*RBtree[K, V]) Insert ¶
func (this *RBtree[K, V]) Insert(key K, value V) (sucs bool, it RBtreeIter[K, V])
func (*RBtree[K, V]) LeftIterate ¶
func (this *RBtree[K, V]) LeftIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
func (*RBtree[K, V]) LowerBound ¶
func (this *RBtree[K, V]) LowerBound(key K) RBtreeIter[K, V]
func (*RBtree[K, V]) MidIterate ¶
func (this *RBtree[K, V]) MidIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
func (*RBtree[K, V]) REnd ¶
func (this *RBtree[K, V]) REnd() RBtreeIter[K, V]
func (*RBtree[K, V]) RightIterate ¶
func (this *RBtree[K, V]) RightIterate(iterfunc func(it RBtreeIter[K, V]) (isbreak bool)) (isbreak bool)
func (*RBtree[K, V]) UpperBound ¶
func (this *RBtree[K, V]) UpperBound(key K) RBtreeIter[K, V]
type RBtreeIter ¶
type RBtreeIter[K, V any] struct { // contains filtered or unexported fields }
func (RBtreeIter[K, V]) Key ¶
func (this RBtreeIter[K, V]) Key() K
func (RBtreeIter[K, V]) Next ¶
func (this RBtreeIter[K, V]) Next() RBtreeIter[K, V]
func (RBtreeIter[K, V]) Prev ¶
func (this RBtreeIter[K, V]) Prev() RBtreeIter[K, V]
func (RBtreeIter[K, V]) SetValue ¶
func (this RBtreeIter[K, V]) SetValue(val V)
func (RBtreeIter[K, V]) Value ¶
func (this RBtreeIter[K, V]) Value() V
type RBtreeKn ¶
----------------------------------------------------------- class RBtreeKn,从小到大排序红黑树
func NewRBtreeKn ¶
type RBtreeRkn ¶
----------------------------------------------------------- class RBtreeKn,反向从大到小排序红黑树