我是嫩叠
我是嫩叠
全部文章
分类
归档
标签
去牛客网
登录
/
注册
我是嫩叠的博客
全部文章
(共22篇)
题解 | #有效括号序列#基于栈
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @return bool布尔型 */ ...
2024-10-15
0
80
题解 | #交互链表节点#交换相邻节点的数值即可
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ class Solution { public: /** * * @param head ListNode类 ...
2024-10-15
0
50
题解 | #求目标值的区间#
class Solution { public: /** * * @param A int整型一维数组 * @param n int A数组长度 * @param target int整型 * @return int整型vector ...
2024-10-15
0
53
题解 | #从前序和中序遍历构造二叉树#和上一题差不多
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
2024-10-11
0
63
题解 | #删除有序链表中重复的元素-II#基于map
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <functional> ...
2024-10-07
0
95
题解 | #不同的二叉搜索树#动态规划
class Solution { public: /** * * @param n int整型 * @return int整型 */ int numTrees(int n) { vector<int> dp(n ...
2024-10-05
0
65
题解 | #二叉树的最小深度#基于bfs
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
2024-10-03
0
79
题解 | #删除有序链表中重复的元素-I#基于哈希表
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <unordered_map&g...
2024-10-02
0
87
题解 | #链表相加(二)#基于stack的方法
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <vector> clas...
2024-10-02
0
101
题解 | #两个链表的第一个公共结点#基于栈
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { publ...
2024-10-02
0
110
首页
上一页
1
2
3
下一页
末页