...

Package redblack

import "github.com/sassoftware/relic/lib/redblack"
Overview
Index

Overview ▾

Simple, incomplete red-black tree implementation meant only to rebuild the directory tree of a CDF file.

type LessFunc

type LessFunc func(i, j interface{}) bool

type Node

type Node struct {
    Item     interface{}
    Less     LessFunc
    Red      bool
    Children [2]*Node
}

type Tree

type Tree struct {
    Root  *Node
    Less  LessFunc
    Count uint
}

func New

func New(less LessFunc) *Tree

func (*Tree) Insert

func (t *Tree) Insert(item interface{})

func (*Tree) Nodes

func (t *Tree) Nodes() []*Node