viant / gds

GoLang data structure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gds GoLang data structure

Generics implementation for data structures in Go.

Usage

Tree

Red Black Tree

Red–black tree

package mypkg

import (
	"fmt"
	"github.com/viant/gds/tree/redblack"
)


func ExampleNewTree() {
	tree := redblack.NewTree[int, redblack.Integer]()
	tree.Insert(1)
	tree.Insert(101)
	tree.Insert(54)
	sorted := tree.InOrderTraversal()
	fmt.Printf("%v\n", sorted)
}

License

The source code is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.

About

GoLang data structure

License:Apache License 2.0


Languages

Language:Go 100.0%