菜菜子不想再菜了
菜菜子不想再菜了
全部文章
分类
归档
标签
去牛客网
登录
/
注册
菜菜子不想再菜了的博客
全部文章
(共84篇)
题解 | #删除有序链表中重复的元素-II#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-06-07
0
132
题解 | #删除有序链表中重复的元素-I#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-06-07
0
133
题解 | #链表的奇偶重排#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-06-06
0
97
题解 | #判断一个链表是否为回文结构#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ #include <cstddef> cla...
2024-06-06
0
151
题解 | #单链表的排序#
呜呜呜呜呜,辛辛苦苦写的快排,结果过不了呜呜呜呜呜!!!!样例太刁钻了吧,归并也就是最坏情况比快排好而已啊。。。 class Solution { public: //合并两段有序链表 ListNode* merge(ListNode* pHead1, ListNode* pHe...
2024-06-05
0
280
题解 | #链表相加(二)#
我服了,题目不是说长度在10的6次方以内吗?怎么样例有个40位数!写了半天发现longlong都不够。。。不过反转链表还是很重要的知识点: ListNode* reverseList(ListNode* head){ ListNode* cur = head; ListNode* node ...
2024-06-05
0
98
题解 | #两个链表的第一个公共结点#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { publ...
2024-06-04
0
89
题解 | #链表中倒数最后k个结点#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-06-04
0
98
题解 | #链表中环的入口结点#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ class Solution { public:...
2024-06-03
0
97
题解 | #判断链表中是否有环#
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2024-06-03
0
137
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页