Skip to content
trivigyPublic

About

Implementation of the multiset data structure

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

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

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages