tree

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Value interface{}
	// contains filtered or unexported fields
}

func New

func New(val interface{}) *Node

New creates and returns a root node of one tree with val.

func (*Node) AddSubNode

func (n *Node) AddSubNode(val interface{}) *Node

AddSubNode adds a sub node to n and return the sub node.

func (*Node) PrintTree

func (n *Node) PrintTree(w io.Writer, f func(*Node) string)

PrintTree prints the tree graphic started from node n.

func (*Node) Walk

func (n *Node) Walk(f func(*Node))

Walk goes trough the tree by f, first at n and then its sub nodes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL