Skip to content
/ bst Public

Fast and generic Set and Map implementations using binary-search-trees.

License

Notifications You must be signed in to change notification settings

bsm/bst

Repository files navigation

bst set/map

Build Status GoDoc Go Report Card License

Fast and generic Set and Map implementations using binary-search-trees.

Documentation

Full documentation is available on GoDoc

Examples

As a Set:

{
	set := bst.NewSet(5)
	set.Add(bst.Int(3))
	set.Add(bst.Int(5))
	set.Add(bst.Int(1))
	set.Add(bst.Int(3))

	for iter := set.Iterator(); iter.Next(); {
		fmt.Println(iter.Value())
	}
}

As a Map:

{
	set := bst.NewMap(5)
	set.Set(bst.Int(5), "bar")
	set.Set(bst.Int(3), "foo")

	for iter := set.Iterator(); iter.Next(); {
		fmt.Println(iter.Key(), iter.Value())
	}
}

About

Fast and generic Set and Map implementations using binary-search-trees.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published