Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trivigy/multiset
Implementation of the multiset data structure
https://github.com/trivigy/multiset
algorithm data-structure go multiset
Last synced: about 2 months ago
JSON representation
Implementation of the multiset data structure
- Host: GitHub
- URL: https://github.com/trivigy/multiset
- Owner: trivigy
- License: mit
- Created: 2019-03-23T05:27:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-23T21:24:26.000Z (over 5 years ago)
- Last Synced: 2024-06-20T16:35:20.307Z (8 months ago)
- Topics: algorithm, data-structure, go, multiset
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Multiset
[![CircleCI branch](https://img.shields.io/circleci/project/github/trivigy/multiset/master.svg?label=master&logo=circleci)](https://circleci.com/gh/trivigy/workflows/multiset)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md)
[![](https://godoc.org/github.com/trivigy/multiset?status.svg&style=flat)](http://godoc.org/github.com/trivigy/multiset)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/trivigy/multiset.svg?style=flat&color=e36397&label=release)](https://github.com/trivigy/multiset/releases/latest)Multiset is a threadsafe abstract data structure library for representing
collection of distinct values, without any particular order. Unlike a set,
multiset allows multiple instances for each of its elements.### Example
```go
package mainimport (
"fmt"
"github.com/trivigy/multiset"
)func main() {
m := multiset.New("b", "b", "c", "d")
fmt.Println(m.Contains("b", "c", "d"))
m1 := multiset.New()
m1.AddCount("a", 3)
m1.AddCount("b", 2)
fmt.Println(m1.DistinctElements())
}
```