aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/armon/go-radix/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/armon/go-radix/README.md')
-rw-r--r--vendor/github.com/armon/go-radix/README.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/armon/go-radix/README.md b/vendor/github.com/armon/go-radix/README.md
new file mode 100644
index 0000000..26f42a2
--- /dev/null
+++ b/vendor/github.com/armon/go-radix/README.md
@@ -0,0 +1,38 @@
1go-radix [![Build Status](https://travis-ci.org/armon/go-radix.png)](https://travis-ci.org/armon/go-radix)
2=========
3
4Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree).
5The package only provides a single `Tree` implementation, optimized for sparse nodes.
6
7As a radix tree, it provides the following:
8 * O(k) operations. In many cases, this can be faster than a hash table since
9 the hash function is an O(k) operation, and hash tables have very poor cache locality.
10 * Minimum / Maximum value lookups
11 * Ordered iteration
12
13For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix).
14
15Documentation
16=============
17
18The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix).
19
20Example
21=======
22
23Below is a simple example of usage
24
25```go
26// Create a tree
27r := radix.New()
28r.Insert("foo", 1)
29r.Insert("bar", 2)
30r.Insert("foobar", 2)
31
32// Find the longest prefix match
33m, _, _ := r.LongestPrefix("foozip")
34if m != "foo" {
35 panic("should be foo")
36}
37```
38