AIGC
AIGC
全部文章
题解
归档
标签
去牛客网
登录
/
注册
AIGC的博客
全部文章
/ 题解
(共25篇)
题解 | #二叉搜索树的第k个结点#
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
C++
2021-10-15
0
375
题解 | #删除链表中重复的结点#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ class Solution { public: ...
C++
2021-10-14
0
291
题解 | #复杂链表的复制#
/* struct RandomListNode { int label; struct RandomListNode *next, *random; RandomListNode(int x) : label(x), next(NULL), rand...
C++
链表
2021-10-14
0
380
题解 | #加起来和为目标值的组合#
class Solution { public: vector<vector<int> > combinationSum2(vector<int> &num, int target) { vector<vector<in...
C++
深度优先搜索
回溯
2021-10-13
0
426
题解 | #最长回文子串#
class Solution { public: void manacher(string s,int n,vector<int>& p){ int m = 0; int r = m + p[0]; //回文串的最右点 fo...
C++
2021-10-13
1
546
题解 | #最长回文子串#
class Solution { public: int getLongestPalindrome(string A, int n) { // write code here if(n < 2)return A.size(); //处理特...
C++
2021-10-13
0
338
题解 | #最长回文子串#
class Solution { public: //时间n的平方,空间1的方法 bool isornot(string s){ string ss = s; reverse(s.begin(), s.end()); return s ...
C++
2021-10-13
0
236
题解 | #斐波那契数列#
class Solution { public: int Fibonacci(int n) { //动态规划 int n1 = 0, n2 = 1; while(--n){ n2 = n1 + n2; ...
C++
动态规划
2021-10-13
0
273
题解 | #斐波那契数列#
class Solution { public: //递归 int Fibonacci(int n) { if(n == 1 || n ==2) return 1; return Fibonacci(n-1) + Fibonacci(n-2); }...
C++
递归
2021-10-13
0
428
题解 | #两个链表生成相加链表#
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
C++
链表
2021-10-13
0
457
首页
上一页
1
2
3
下一页
末页