Documentation
¶
Index ¶
- type Vector
- func (this *Vector[T]) BinSearch(e T, lo, hi int) (rank int)
- func (this *Vector[T]) Clear()
- func (this *Vector[T]) Deduplicate() (removedNumber int)
- func (this *Vector[T]) DeepEqual(another *Vector[T]) (equal bool)
- func (this *Vector[T]) Disordered() (disorderedNumber int)
- func (this *Vector[T]) Find(e T, lo, hi int) (rank int)
- func (this *Vector[T]) Get(r int) (element T, err error)
- func (this *Vector[T]) Insert(r int, element T) (rank int)
- func (this *Vector[T]) IsEmpty() bool
- func (this *Vector[T]) MergeSort(lo, hi int)
- func (this *Vector[T]) PopBack() (element T)
- func (this *Vector[T]) PushBack(e T)
- func (this *Vector[T]) Put(r int, newElement T) (err error)
- func (this *Vector[T]) Remove(lo, hi int) (removedNumber int)
- func (this *Vector[T]) Remove1(r int) (removedElement T)
- func (this *Vector[T]) Reverse()
- func (this *Vector[T]) Search(e T) (rank int)
- func (this *Vector[T]) Size() (usedSize int)
- func (this *Vector[T]) String() string
- func (this *Vector[T]) ToSlice() []T
- func (this *Vector[T]) Traverse(visit func(element *T))
- func (this *Vector[T]) Uniquify() (deletedNumber int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
数组列表数据结构,默认采用切片slice,使用数组需使用特定的方法
func NewFromVector ¶
NewFromVector 从已有列表/向量子区间构造
func (*Vector[T]) Deduplicate ¶
无序去重,可以保持低秩方向不同元素间的稳定性
func (*Vector[T]) DeepEqual ¶ added in v0.0.3
值判等,以值相等原则进行比较 定义:一个列表在"内容视图"上的相等包括:容量、链表的元素序列 相等,忽略其中的指针
func (*Vector[T]) Insert ¶
插入元素,插入元素 element 到已被占用的秩 r,原向量中自r及其后的元素依次后移一位 警告:不得插入未使用的秩处,尤其是最后一个秩之后的一个位置
func (*Vector[T]) PopBack ¶
func (this *Vector[T]) PopBack() (element T)
尾部弹出一个元素 警告:不会检查对象是否为空向量,调用方需自行保证对象不为空
Click to show internal directories.
Click to hide internal directories.