Skip to content

Instantly share code, notes, and snippets.

@arafatkatze
Created May 8, 2018 18:14
Show Gist options
  • Save arafatkatze/60e199ae56f7b31efdf5a8e7afe30c5c to your computer and use it in GitHub Desktop.
Save arafatkatze/60e199ae56f7b31efdf5a8e7afe30c5c to your computer and use it in GitHub Desktop.
An example of Maps in Dataviz
package main
import (
rbt "github.com/Arafatk/dataviz/trees/redblacktree"
)
func main() {
tree := rbt.NewWithIntComparator()
tree.Put(5, "e")
tree.Put(6, "f")
tree.Put(7, "g")
tree.Put(3, "c")
tree.Put(4, "d")
tree.Put(1, "x")
tree.Put(2, "b")
tree.Put(1, "a") //overwrite
tree.Visualizer("out.png")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment