tree

package
v0.0.0-...-7253c86 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalancedBinaryTree

func BalancedBinaryTree(root *util.TreeNode) bool

func BinaryTreeLevelOrderTraversal

func BinaryTreeLevelOrderTraversal(root *util.TreeNode) [][]int

func BinaryTreeMaximumPathSum

func BinaryTreeMaximumPathSum(root *util.TreeNode) int

func BinaryTreeRightSideView

func BinaryTreeRightSideView(root *util.TreeNode) []int

func ConstructBinaryTreeFromPreorderAndInorderTraversal

func ConstructBinaryTreeFromPreorderAndInorderTraversal(preorder []int, inorder []int) *util.TreeNode

func CountGoodNodesInBinaryTree

func CountGoodNodesInBinaryTree(root *util.TreeNode) int

func DiameterOfBinaryTree

func DiameterOfBinaryTree(root *util.TreeNode) int

func InvertBinaryTree

func InvertBinaryTree(root *util.TreeNode) *util.TreeNode

func KthSmallestElementInABST

func KthSmallestElementInABST(root *util.TreeNode, k int) int

func LowestCommonAncestorOfABinarySearchTree

func LowestCommonAncestorOfABinarySearchTree(root, p, q *util.TreeNode) *util.TreeNode

func MaximumDepthOfBinaryTree

func MaximumDepthOfBinaryTree(root *util.TreeNode) int

func SameTree

func SameTree(p *util.TreeNode, q *util.TreeNode) bool

func SubtreeOfAnotherTree

func SubtreeOfAnotherTree(root *util.TreeNode, subRoot *util.TreeNode) bool

func ValidateBinarySearchTree

func ValidateBinarySearchTree(root *util.TreeNode) bool

Types

type Codec

type Codec struct {
}

func Constructor

func Constructor() Codec

func (*Codec) Deserialize

func (this *Codec) Deserialize(data string) *util.TreeNode

Deserializes your encoded data to tree.

func (*Codec) Serialize

func (this *Codec) Serialize(root *util.TreeNode) string

Serializes a tree to a single string.

Jump to

Keyboard shortcuts

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