李顺利plus
李顺利plus
全部文章
分类
题解(15)
归档
标签
去牛客网
登录
/
注册
李顺利plus的博客
全部文章
(共90篇)
题解 | #岛屿数量#
class Solution { public: int res = 0; void find(vector<vector<char> >& grid, int i, int j, int m, int n) { int dx[4] = {0...
2023-03-12
0
304
题解 | #链表内指定区间反转#
#include <cstdio> class Solution { public: 时间复杂度On 空间复杂度O1 ListNode* reverseBetween(ListNode* head, int m, int n) { ListNode* q = ...
2023-03-07
0
347
题解 | #机器人的运动范围#
class Solution { public: int movingCount(int threshold, int rows, int cols) { if(rows == 0 && cols == 0) return 0; //特殊情况判断 int r...
2023-01-07
0
401
题解 | #数组中的逆序对#
class Solution { public: const int P = 1000000007; int merge(vector<int> &data, int l, int r){ //y总的归并排序 if(l >= r) return...
2023-01-06
0
319
题解 | #表示数值的字符串#
class Solution { public: bool isNumeric(string s) { // write code here int i = 0; while (i < s.size() && s[i] == ' ') i...
2023-01-05
0
294
题解 | #复杂链表的复制#
class Solution { public: RandomListNode* Clone(RandomListNode* pHead) { if(pHead == NULL) return {}; RandomListNode* p = pHead; ...
2023-01-05
0
337
题解 | #树的子结构#
class Solution { public: bool panduan(TreeNode* p1,TreeNode* p2){ if(p1 == NULL && p2 != NULL) return false; //主树先空不对 if(p1 == NULL || p2 == NU...
2023-01-04
0
348
题解 | #二叉搜索树的后序遍历序列#
class Solution { public: bool VerifySquenceOfBST(vector<int> sequence) { if(sequence.size() == 0) return false; queue<int...
2023-01-04
0
339
题解 | #顺时针打印矩阵#
class Solution { public: vector<int> printMatrix(vector<vector<int> > matrix) { int up = 0 , left = 0; int down ...
2023-01-04
0
299
题解 | #二叉搜索树与双向链表#
class Solution { public: TreeNode* pre; void bianli(TreeNode* p){ if(p->left != NULL) bianli(p->left); if(pre != p){ //头节点不用操作 pre-&...
2023-01-04
0
284
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页