Skip to content

Latest commit

 

History

History

sortedmap

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

hashmap

Go Version Go Reference Build Status License

Generic sortedmap of Golang. Golang 泛型 sortedmap 实现。

Need v1.18+

Example

{
    hash := sortedmap.New[int, int]()

    for i := 0; i < 10; i++ {
        sm.Set(i, i)
    }

    sm.ForEach(func(key, val int) {
        println(key, val)
    })

    // 0 1 2 3 4 5 6 7 8 9
}

Installation

go get github.com/shalldie/gog/sortedmap

Description

sortedmap is a collection that has sorted elements, the usage can refer to HashMap.

sortedmap 是一个含有排序元素的集合,使用方式可参考 HashMap

License

MIT