- 博客(4)
- 收藏
- 关注
原创 【Leetcode】104. Maximum Depth of Binary Tree
https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/文章目录1. 描述2. 解决2.1 递归(DFS——深度优先)2.2 迭代(BFS——广度优先)1. 描述Given the root of a binary tree, return its maximum depth.A binary tree’s maximum depth is the number of nodes along the longest path fro
2021-11-19 01:34:21 274
原创 【Leetcode】101. Symmetric Tree
https://leetcode-cn.com/problems/symmetric-tree/文章目录1. 描述2. 解决2.1 递归——DFS(深度优先)2.2 迭代——BFS(深度优先)1. 描述Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).2. 解决2.1 递归——DFS(深度优先)递归思想:左孩子的左孩子 = 右
2021-11-16 20:11:06 200
原创 【Leetcode】100. Same Tree
https://leetcode-cn.com/problems/same-tree/文章目录1. 描述2. 解决2.1 递归——DFS(深度优先)2.2 迭代——BFS(广度优先)1. 描述Given the roots of two binary trees p and q, write a function to check if they are the same or not.Two binary trees are considered the same if they are stru
2021-11-16 00:33:47 363
原创 【Leetcode】94. Binary Tree Inorder Traversal
https://leetcode-cn.com/problems/binary-tree-inorder-traversal/文章目录1. 描述2. 解决2.1 递归2.2 迭代2.3 莫里斯(Morris)遍历1. 描述Given the root of a binary tree, return the inorder traversal of its nodes’ values.2. 解决2.1 递归前序遍历:中 - 左 - 右中序遍历:左 - 中 - 右后序遍历:左 - 右 - 中
2021-11-15 20:27:41 368
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人