Serenity

热爱可抵岁月漫长

一个热爱技术、喜欢折腾的开发者。 专注于前端开发,偶尔写写后端。 记录生活,分享技术,探索未知。

点击任意处进入哦~
加载中
输入关键词开始搜索
leetcode404. 左叶子之和

leetcode404. 左叶子之和

暂无摘要...

leetcode
简单 树
3月 Serenity
leetcode110. 平衡二叉树

leetcode110. 平衡二叉树

暂无摘要...

leetcode
简单 树
3月 Serenity
leetcode257. 二叉树的所有路径

leetcode257. 二叉树的所有路径

暂无摘要...

leetcode
简单 树
3月 Serenity
leetcode111. 二叉树的最小深度

leetcode111. 二叉树的最小深度

暂无摘要...

leetcode
简单 树
3月 Serenity
leetcode104. 二叉树的最大深度

leetcode104. 二叉树的最大深度

暂无摘要...

leetcode
简单 树
3月 Serenity
leetcode222. 完全二叉树的节点个数

leetcode222. 完全二叉树的节点个数

bfsclass Solution {public: int countNodes(TreeNode* root) { int num=0; if(root==nullptr)return num; queue<TreeNode*>q;

leetcode
中等 树
3月 Serenity
leetcode297. 二叉树的序列化与反序列化

leetcode297. 二叉树的序列化与反序列化

暂无摘要...

leetcode
困难 树
3月 Serenity
leetcode450. 删除二叉搜索树中的节点

leetcode450. 删除二叉搜索树中的节点

分析如果目标节点大于当前节点值,则去右子树中删除;如果目标节点小于当前节点值,则去左子树中删除;如果目标节点就是当前节点,分为以下三种情况:其无左子:其右子顶替其位置,删除了该节点;其无右子:其左子顶替其位置,删除了该节点;其左右子节点都有:其左子树转移到其右子树的最左节点的左子树上,然后右子树顶替

leetcode
中等 树
3月 Serenity
leetcode1038. 从二叉搜索树到更大和树

leetcode1038. 从二叉搜索树到更大和树

分析二叉搜索树的先序遍历就是从小到大排列,那么反过来逆先序遍历就是从大到小,此时将sum赋给根节点即可。/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left;

leetcode
简单 树
3月 Serenity
leetcode108. 将有序数组转换为二叉搜索树

leetcode108. 将有序数组转换为二叉搜索树

暂无摘要...

leetcode
简单 树
3月 Serenity