Documentation
¶
Overview ¶
Package binary 二叉树定义
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryTree ¶
BinaryTree 二叉树.
func FromLevelOrder ¶
func FromLevelOrder[T cmp.Ordered](data []T) *BinaryTree[T]
FromLevelOrder 根据层序遍历结果反序列化成一颗树
层序遍历结果要求带上空节点(使用空值替代).
func NewBinaryTree ¶
func NewBinaryTree[T cmp.Ordered]() *BinaryTree[T]
func (*BinaryTree[T]) LevelOrderRecursive ¶
func (t *BinaryTree[T]) LevelOrderRecursive() []T
LevelOrderRecursive 层序遍历递归实现.
Click to show internal directories.
Click to hide internal directories.