数据结构
-
【算法题解】41. 二叉树的中序遍历
❝ 这是一道 「简单」 题https://leetcode.cn/problems/binary-tree-inorder-traversal/ ❞ 题目 给定一个二叉树的根节点 …
-
【算法题解】42. 二叉树的前序遍历
❝ 这是一道 「简单」 题https://leetcode.cn/problems/binary-tree-preorder-traversal/ ❞ 题目 给你二叉树的根节点 r…
-
【算法题解】43. 二叉树的后序遍历
❝ 这是一道 「简单」 题https://leetcode.cn/problems/binary-tree-postorder-traversal/ ❞ 题目 给你一棵二叉树的根节…
-
【算法题解】44. N 叉树的前序遍历(递归 + 迭代)
❝ 这是一道 「简单」 题https://leetcode.cn/problems/n-ary-tree-preorder-traversal/ ❞ 题目 给定一个 n 叉树的根节…
-
【算法题解】45. N叉树的层序遍历
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/n-ary-tree-level-order-traversal/ ❞ 题目 给定一个 N…
-
【算法题解】46. 二叉树的层序遍历
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/binary-tree-level-order-traversal/ ❞ 题目 给你二叉树…
-
【算法题解】47. 从前序与中序遍历序列构造二叉树
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inord…
-
【算法题解】48. 从中序与后序遍历序列构造二叉树
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/construct-binary-tree-from-inorder-and-postor…
-
【算法题解】50. 二叉树的直径
❝ 这是一道 「简单」 题https://leetcode.cn/problems/diameter-of-binary-tree/ ❞ 题目 给你一棵二叉树的根节点,返回该树的 …
-
【算法题解】51. 二叉树的最近公共祖先
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/ ❞ 题目…
-
【算法题解】52. 分割圆的最少切割次数
❝ 这是一道 「简单」 题https://leetcode.cn/problems/minimum-cuts-to-divide-a-circle/ ❞ 题目 圆内一个 有效切割 …
-
【算法题解】53. 统计封闭岛屿的数目
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/number-of-closed-islands/ ❞ 题目 二维矩阵 grid 由 (土…
-
【算法题解】54. 树的冗余连接
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/redundant-connection/ ❞ 题目 树可以看成是一个连通且 「无环」 的…
-
【算法题解】55. 数组中字符串的最大值
❝ 这是一道 「简单」 题 https://leetcode.cn/problems/maximum-value-of-a-string-in-an-array/ ❞ 题目 一个由…
-
【算法题解】56. 课程表(图的广度优先搜索)
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/course-schedule/ ❞ 题目 你这个学期必须选修 门课程,记为 到 。 在选…
-
【算法题解】57. 课程表(图的深度优先搜索)
❝ 这是一道 「中等难度」 的题https://leetcode.cn/problems/course-schedule/ ❞ 题目 你这个学期必须选修 门课程,记为 到 。 在选…