binarytree

package
v0.0.0-...-2b489ef Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const EMPTY_NODE = math.MinInt

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

func NewTree

func NewTree(nums []int) *TreeNode

NewTree constructs binary tree from value slice. [0,1,2,3,4,5,6]

     0
   /   \
  1     2
 / \   / \
3   4 5   6

Jump to

Keyboard shortcuts

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