File tree Expand file tree Collapse file tree
04.MaximumDepthOfBinaryTree
06.ValidateBinarySearchTree
07.ConvertSortedListToBinarySearchTree
08.FlattenBinaryTreeToLinkedList
09.BinaryTreeLevelTraversal
12.ConvertToBinarySearchTree Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Same Tree(相同的树)
2- LeetCode 100
3- [ English] ( https://leetcode.com/problems/same-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/same-tree/ )
2+
3+ ** LeetCode 100**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/same-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/same-tree/ )
58
69## 题目
10+ 给定两个二叉树,编写一个函数来检验它们是否相同。
11+
12+ 如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。
13+
14+ 示例 1:
15+ ```
16+ 输入: 1 1
17+ / \ / \
18+ 2 3 2 3
19+
20+ [1,2,3], [1,2,3]
21+
22+ 输出: true
23+ ```
24+
25+ 示例 2:
26+ ```
27+ 输入: 1 1
28+ / \
29+ 2 2
30+
31+ [1,2], [1,null,2]
32+
33+ 输出: false
34+ ```
35+
36+ 示例 3:
37+ ```
38+ 输入: 1 1
39+ / \ / \
40+ 2 1 1 2
41+
42+ [1,2,1], [1,1,2]
43+
44+ 输出: false
45+ ```
746
847## 思路
948<details >
Original file line number Diff line number Diff line change 11# Symmetric Tree (对称二叉树)
2- LeetCode 101
3- [ English] ( https://leetcode.com/problems/symmetric-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/symmetric-tree/ )
2+
3+ ** LeetCode 101**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/symmetric-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/symmetric-tree/ )
58
69## 题目
710给定一个二叉树,检查它是否是镜像对称的。
Original file line number Diff line number Diff line change 11# Invert Binary Tree(翻转二叉树)
2- LeetCode 226
3- [ English] ( https://leetcode.com/problems/invert-binary-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/invert-binary-tree/ )
2+
3+ ** LeetCode 226**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/invert-binary-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/invert-binary-tree/ )
58
69## 题目
710翻转一棵二叉树。
Original file line number Diff line number Diff line change 11# Maximum Depth of Binary Tree(二叉树的最大深度)
2- LeetCode 104
3- [ English] ( https://leetcode.com/problems/maximum-depth-of-binary-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ )
2+
3+ ** LeetCode 104**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/maximum-depth-of-binary-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ )
58
69## 题目
710给定一个二叉树,找出其最大深度。
Original file line number Diff line number Diff line change 11# Balanced Binary Tree(平衡二叉树)
2- LeetCode 110
3- [ English] ( https://leetcode.com/problems/balanced-binary-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/balanced-binary-tree/ )
2+
3+ ** LeetCode 110**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/balanced-binary-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/balanced-binary-tree/ )
58
69## 题目
710给定一个二叉树,判断它是否是高度平衡的二叉树。
Original file line number Diff line number Diff line change 11# Validate Binary Search Tree(验证二叉查找树)
2- LeetCode 98
3- [ English] ( https://leetcode.com/problems/validate-binary-search-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/validate-binary-search-tree/ )
2+
3+ ** LeetCode 98**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/validate-binary-search-tree/ )
6+ - [ 中文版] ( https://leetcode-cn.com/problems/validate-binary-search-tree/ )
57
68## 题目
79给定一个二叉树,判断其是否是一个有效的二叉搜索树。
Original file line number Diff line number Diff line change 11# Convert Sorted List to Binary Search Tree(有序链表转换二叉查找树)
2- LeetCode 109
3- [ English] ( https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ )
4- [ 中文] ( https://leetcode-cn.com/problems/convert-sorted-list-to-binary-search-tree/ )
2+
3+ ** LeetCode 109**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/convert-sorted-list-to-binary-search-tree/ )
58
69## 题目
710
Original file line number Diff line number Diff line change 11# Flatten Binary Tree to Linked List(二叉树展开为链表)
2- LeetCode 114
3- [ English] ( https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ )
4- [ 中文] ( https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/ )
2+
3+ ** LeetCode 114**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/ )
58
69## 题目
710给定一个二叉树,原地将它展开为链表。
Original file line number Diff line number Diff line change 11# Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历)
2- LeetCode 103
3- [ English] ( https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ )
4- [ 中文] ( https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/ )
2+
3+ ** LeetCode 103**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/ )
58
69## 题目
710给定一个二叉树,返回其节点值的锯齿形层次遍历。(即先从左往右,再从右往左进行下一层遍历,以此类推,层与层之间交替进行)。
Original file line number Diff line number Diff line change 11# Find Largest Value in Each Tree Row(在每个树行中找最大值)
2- LeetCode 515
3- [ English] ( https://leetcode.com/problems/find-largest-value-in-each-tree-row/ )
4- [ 中文] ( https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/ )
2+
3+ ** LeetCode 515**
4+
5+ - [ 英文版] ( https://leetcode.com/problems/find-largest-value-in-each-tree-row/ )
6+
7+ - [ 中文版] ( https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/ )
58
69## 题目
710
You can’t perform that action at this time.
0 commit comments