golang 数据结构.
Go to file
2019-07-18 14:25:15 +08:00
compare new file: .gitignore 2019-05-08 10:42:51 +08:00
heap benchmark 转移到其他仓库 2019-05-08 17:33:58 +08:00
lastack 修复单元测试的长度判断不正确 2019-05-08 17:57:10 +08:00
list 修改ArrayList的一些bug 2019-07-05 01:10:23 +08:00
map save 2019-05-10 18:01:15 +08:00
priority_queue Iterator 添加GetNode函数, 修改SeNode缺字母SetNode 2019-07-18 14:25:15 +08:00
priority_queuekey Iterator 添加GetNode函数, 修改SeNode缺字母SetNode 2019-07-18 14:25:15 +08:00
set Iterator 添加GetNode函数, 修改SeNode缺字母SetNode 2019-07-18 14:25:15 +08:00
sparse_array benchmark 转移到其他仓库 2019-05-08 17:33:58 +08:00
stack benchmark 转移到其他仓库 2019-05-08 17:33:58 +08:00
tree Iterator 添加GetNode函数, 修改SeNode缺字母SetNode 2019-07-18 14:25:15 +08:00
utils ll完成 2019-05-20 19:12:38 +08:00
.gitignore new file: .gitignore 2019-05-08 10:42:51 +08:00
for_test.go new file: .gitignore 2019-05-08 10:42:51 +08:00
go.mod 完善Remove 2019-05-17 19:54:55 +08:00
go.sum 完善Remove 2019-05-17 19:54:55 +08:00
interface.go new file: .gitignore 2019-05-08 10:42:51 +08:00
LICENSE new file: .gitignore 2019-05-08 10:42:51 +08:00
README.md 添加GetRange的使用例子 2019-07-18 14:05:59 +08:00

structure

暂时没时间整理, 后期才整理完整

PriorityQueue

pq := pqueuekey.New(compare.Int)
pq.Push(1, 1)
pq.Push(4, 4)
pq.Push(5, 5)
pq.Push(6, 6)
pq.Push(2, 2)        // pq.Values() = [6 5 4 2 1]
value, _ := pq.Pop() // value = 6
value, _ = pq.Get(1)        // value = 1 pq.Values() = [5 4 2 1]
value, _ = pq.Get(0)        // value = nil , Get equal to Seach Key
value, _ = pq.Index(0)      // value = 5, compare.Int the order from big to small
values := pq.GetRange(2, 5) // values = [2 4 5]
values = pq.GetRange(5, 2)  // values = [5 4 2]
values = pq.GetRange(100, 2) // values = [5 4 2]
values3 := pq.GetAround(5) //  values3 = [<nil>, 5, 4]