tree_render

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: MIT Imports: 1 Imported by: 1

README

treeprint

将树形结构以一种便于阅读的形式呈现, 需要树中结点实现Node接口, Node接口定义如下: type Node interface { Id() string // 返回结点Id,要求每个结点唯一 Children() []Node String() string // 返回结点的字符串表示,要求不存在换行符 }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print added in v1.0.4

func Print(root Node, minLeafDistance uint32) string

生成以root为根的前缀树的可视化表示

Types

type Node

type Node interface {
	Id() string // 返回结点Id,要求每个结点唯一
	Children() []Node
	String() string // 返回结点的字符串表示,要求不存在换行符
}

Jump to

Keyboard shortcuts

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