cherryoa
cherryoa
全部文章
分类
归档
标签
去牛客网
登录
/
注册
cherryoa的博客
全部文章
(共19篇)
题解 | #跳台阶#
#include <utility> class Solution { public: // 2.使用了带有备忘录的递归,也可以理解成是另类的动态规划 map<int,int> m; int jumpFloor(int number) { //...
2023-05-30
1
267
题解 | #跳台阶#
class Solution { public: // 1. 动态规划 int jumpFloor(int number) { if(number == 1) { return 1; } if (numb...
2023-05-30
0
234
题解 | #删除链表的倒数第n个节点#
class Solution { // 翻转再删除再翻转 public: ListNode* reverseList(ListNode* head) { if (head == nullptr)return head; ListNode* fron...
2023-05-18
0
275
题解 | #链表中倒数最后k个结点#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <stack> class So...
2023-05-18
1
260
题解 | #链表中环的入口结点#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ /* 第一次十分钟解决 第一次一次性过 正式宣布,这...
2023-05-18
0
223
题解 | #判断链表中是否有环#
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2023-05-11
0
248
题解 | #合并k个已排序的链表#
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2023-05-11
0
311
题解 | #合并两个排序的链表#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { publ...
2023-05-10
0
264
题解 | #链表中的节点每k个一组翻转#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ #include <cstdlib> #include <stack> class Solution { public: ...
2023-05-07
0
283
题解 | #链表内指定区间反转#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ class Solution { public: /** * * @param head ListNode类 ...
2023-05-05
0
277
首页
上一页
1
2
下一页
末页