From f00c5f878f1a406a74f516bf06e00e4dc957fc08 Mon Sep 17 00:00:00 2001 From: AlphaHot <58410019+AlphaHot@users.noreply.github.com> Date: Tue, 17 Aug 2021 10:30:53 +0500 Subject: [PATCH] Update README.md --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 742ca0b..acfc8cc 100644 --- a/README.md +++ b/README.md @@ -31,34 +31,34 @@ I consider it to be in stable, perhaps even production, shape. There are no know With a healthy Go Language installed, simply run `go get github.com/petar/GoLLRB/llrb` ## Example - - package main - - import ( - "fmt" - "github.com/petar/GoLLRB/llrb" - ) - - func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } - - func main() { - tree := llrb.New(lessInt) - tree.ReplaceOrInsert(1) - tree.ReplaceOrInsert(2) - tree.ReplaceOrInsert(3) - tree.ReplaceOrInsert(4) - tree.DeleteMin() - tree.Delete(4) - c := tree.IterAscend() - for { - u := <-c - if u == nil { - break - } - fmt.Printf("%d\n", int(u.(int))) - } - } - +```go +package main + +import ( + "fmt" + "github.com/petar/GoLLRB/llrb" +) + +func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } + +func main() { + tree := llrb.New(lessInt) + tree.ReplaceOrInsert(1) + tree.ReplaceOrInsert(2) + tree.ReplaceOrInsert(3) + tree.ReplaceOrInsert(4) + tree.DeleteMin() + tree.Delete(4) + c := tree.IterAscend() + for { + u := <-c + if u == nil { + break + } + fmt.Printf("%d\n", int(u.(int))) + } +} +``` ## About GoLLRB was written by [Petar Maymounkov](http://pdos.csail.mit.edu/~petar/).