From 1620132a9a5a4c2cc2ab376725036a28a597ddd2 Mon Sep 17 00:00:00 2001 From: hlccd <56643462+hlccd@users.noreply.github.com> Date: Wed, 20 Oct 2021 08:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=AF=B9bitmap?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E7=8E=B0=EF=BC=8Cbitmap=E5=B9=B6=E6=9C=AA?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=BA=BF=E7=A8=8B=E5=AE=89=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- goSTL/data_structure/vector/vector.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/goSTL/data_structure/vector/vector.go b/goSTL/data_structure/vector/vector.go index f7a7970..3642216 100644 --- a/goSTL/data_structure/vector/vector.go +++ b/goSTL/data_structure/vector/vector.go @@ -3,7 +3,7 @@ package vector //@Title vector //@Description // vector向量容器包 -// 以切片数组的形式实现 +// 以动态数组的形式实现 // 该容器可以在尾部实现线性增减元素 // 通过interface实现泛型 // 可接纳不同类型的元素 @@ -24,8 +24,9 @@ import ( //当添加节点时尾指针大于已分配空间长度,则新增空间 type vector struct { - data []interface{} //泛型切片 - end int //尾指针 + data []interface{} //动态数组 + len uint64 //当前已用数量 + cap uint64 //可容纳元素数量 mutex sync.Mutex //并发控制锁 }