Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Multiset

CircleCI branch License GitHub tag (latest SemVer)

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

package main

import (
    "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())
}

About

Implementation of the multiset data structure

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages