Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
An Adaptive Radix Tree Implementation in Go
====

[![Coverage Status](https://coveralls.io/repos/github/plar/go-adaptive-radix-tree/badge.svg?branch=master&v=1)](https://coveralls.io/github/plar/go-adaptive-radix-tree?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/plar/go-adaptive-radix-tree)](https://goreportcard.com/report/github.com/plar/go-adaptive-radix-tree) [![GoDoc](https://godoc.org/github.com/plar/go-adaptive-radix-tree?status.svg)](http://godoc.org/github.com/plar/go-adaptive-radix-tree)
[![Coverage Status](https://coveralls.io/repos/github/plar/go-adaptive-radix-tree/badge.svg?branch=master&v=1)](https://coveralls.io/github/plar/go-adaptive-radix-tree?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/plar/go-adaptive-radix-tree)](https://goreportcard.com/report/github.com/plar/go-adaptive-radix-tree) [![GoDoc](https://godoc.org/github.com/plar/go-adaptive-radix-tree?status.svg)](https://pkg.go.dev/github.com/plar/go-adaptive-radix-tree/v2)

This library provides a Go implementation of the Adaptive Radix Tree (ART).

Expand Down
44 changes: 23 additions & 21 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,42 @@
//
// The design of ART is based on "The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases" [1].
//
// Usage
// Usage:
//
// package main
//
// import (
// "fmt"
// "github.com/plar/go-adaptive-radix-tree/v2"
// "fmt"
//
// art "github.com/plar/go-adaptive-radix-tree/v2"
// )
//
// func main() {
//
// tree := art.New()
// tree := art.New()
//
// tree.Insert(art.Key("Hi, I'm Key"), "Nice to meet you, I'm Value")
// value, found := tree.Search(art.Key("Hi, I'm Key"))
// if found {
// fmt.Printf("Search value=%v\n", value)
// }
// tree.Insert(art.Key("Hi, I'm Key"), "Nice to meet you, I'm Value")
// value, found := tree.Search(art.Key("Hi, I'm Key"))
// if found {
// fmt.Printf("Search value=%v\n", value)
// }
//
// tree.ForEach(func(node art.Node) bool {
// fmt.Printf("Callback value=%v\n", node.Value())
// return true
// }
// tree.ForEach(func(node art.Node) bool {
// fmt.Printf("Callback value=%v\n", node.Value())
// return true
// })
//
// for it := tree.Iterator(); it.HasNext(); {
// value, _ := it.Next()
// fmt.Printf("Iterator value=%v\n", value.Value())
// }
// for it := tree.Iterator(); it.HasNext(); {
// value, _ := it.Next()
// fmt.Printf("Iterator value=%v\n", value.Value())
// }
// }
//
// // Output:
// // Search value=Nice to meet you, I'm Value
// // Callback value=Nice to meet you, I'm Value
// // Iterator value=Nice to meet you, I'm Value
// Output:
//
// Search value=Nice to meet you, I'm Value
// Callback value=Nice to meet you, I'm Value
// Iterator value=Nice to meet you, I'm Value
//
// Also the current implementation was inspired by [2] and [3]
//
Expand Down
Loading