Skip to content

1eedaegon/go-hashset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-hashset

Go CI CodeQL

A go library hashset for O(1)

Example

Initialize set and Add element

import (
	...
	hashset "github.com/1eedaegon/go-hashset"
	...
)

	s := hashset.New(1, 2, "3")
	s.Add("3") // Since "3" already exists in the Set, its size remains 3.

Remove and Distinguish between different types

import (
	...
	hashset "github.com/1eedaegon/go-hashset"
	...
)
    s := hashset.New("1", "2", 3)
	s.Remove("1")
	s.Remove("multiple")
	s.Remove("3") // The length of s is 2, because due to the difference in types.

Other case doc: https://pkg.go.dev/github.com/1eedaegon/go-hashset

License

MIT

About

A go library hashset for O(1)

Resources

License

Stars

Watchers

Forks

Packages

No packages published