constructbinarytreefrompreorderandinordertraversal

package
v0.0.0-...-77685de Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeNode

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

*

  • Definition for a binary tree node.
  • type TreeNode struct {
  • Val int
  • Left *TreeNode
  • Right *TreeNode
  • }

func BuildTree

func BuildTree(preorder []int, inorder []int) *TreeNode

Method 1 參考 https://labuladong.github.io/algo/2/21/38/ 詳解 利用 前序和中序 的排列特性組成 tree

Jump to

Keyboard shortcuts

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