Skip to content

gdstructer是一个golang实现的常用数据结构

License

Notifications You must be signed in to change notification settings

zr-hebo/gdstructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdstructure

gdstructure是一个golang实现的常用数据结构的包。 其中Queue是一个基于动态数组实现的线程安全的FIFO队列

Install

Use go get to install this package:
$ go get github.com/zr-hebo/gdstructure

Usage

import (
	gds "github.com/zr-hebo/gdstructure"
	"fmt"
)

// Int类型队列
queue1 := gds.NewQueue()
queue1.Enqueue(1)
data := queue1.Dequeue()
intVal := data.(int)
fmt.Printf("%T %v\n", intVal, intVal)

// string类型队列
queue2 := gds.NewQueue()
queue2.Enqueue("haha")

data = queue2.Dequeue()
strVal := data.(string)
fmt.Printf("%T %v\n", intVal, intVal)

☁️☁️☁️

About

gdstructer是一个golang实现的常用数据结构

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages