在海里blueblue
在海里blueblue
全部文章
分类
归档
标签
去牛客网
登录
/
注册
在海里blueblue的博客
全部文章
(共8篇)
题解 | 链表内指定区间反转
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: Li...
2025-12-17
0
6
题解 | 二叉树的后序遍历 迭代
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-12-16
0
6
题解 | 判断一个链表是否为回文结构 快慢指针+反转链表
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: Li...
2025-12-16
0
8
题解 | 游游的字母翻倍
#include <bits/stdc++.h> using namespace std; // 模拟 字符串 int main() { int n, q, l, r; string str; cin >> n >> q; cin...
2025-12-16
1
8
题解 | 链表相加(二)
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: Li...
2025-12-15
0
7
题解 | 合并k个已排序的链表
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { ListNode* ...
2025-12-15
1
10
题解 | 合并两个排序的链表
class Solution { public: ListNode* Merge(ListNode* pHead1, ListNode* pHead2) { if (!pHead1) return pHead2; if (!pHead2) return pHe...
2025-12-15
1
9
题解 | 合并两个排序的链表
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: Li...
2025-12-15
1
11