Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.19 KB

README.md

File metadata and controls

48 lines (32 loc) · 1.19 KB

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