2022-05-03 18:52:56 +08:00
2022-04-26 17:09:56 +08:00
2022-05-03 18:52:56 +08:00
2022-05-03 18:52:56 +08:00
2022-05-03 18:52:56 +08:00
2022-04-02 13:20:32 +08:00
2022-04-26 14:26:02 +08:00
2022-04-26 14:26:02 +08:00
2022-05-03 18:52:56 +08:00
2022-04-02 13:20:32 +08:00
2022-04-02 04:54:16 +00:00
2022-04-02 14:30:40 +08:00

stl-go

一个封装了一些简单的数据结构的提供泛型支持的stl库 (go >= 1.18)

usage

Dequeue

package main

import (
	"fmt"

	"gitee.com/NorthCityChen/stl-go/dequeue"
)

func main() {
	q := dequeue.Init[int]()
	q.LPush(12)
	q.LPush(23)
	q.LPush(34)
	q.Clear()
	q.LPush(34)
	q.RPush(44)
	fmt.Println(q.LPop())
	fmt.Println(q.LPop())
	fmt.Println(q.LPop())
	fmt.Println(q.LPop())
}

Queue

import (
	"fmt"

	"gitee.com/NorthCityChen/stl-go/queue"
)

func main() {
	q := queue.Init[int]()
	q.Push(12)
	q.Push(23)
	q.Push(44)
	fmt.Println(q.Pop())
	fmt.Println(q.Pop())
	fmt.Println(q.Pop())
	fmt.Println(q.Pop())
}

RoadMap

  • 双端队列
  • 队列
  • 数学
  • 优先队列
  • 红黑树
  • 集合
  • 二分查找
  • 下一个排序组合
Description
No description provided
Readme MIT 42 KiB
Languages
Go 100%