牛客768685351号
牛客768685351号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客768685351号的博客
全部文章
/ 题解
(共160篇)
题解 | #反转链表#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* Rever...
C++
2022-02-21
0
235
题解 | #连续子数组的最大和#
class Solution { public: int FindGreatestSumOfSubArray(vector<int> array) { int n = array.size(); int max_val = arr...
C++
2022-02-21
0
232
题解 | #顺时针旋转矩阵#
先进行上下翻转,再进行斜对角线翻转,可实现90度旋转。 class Solution { public: vector<vector<int> > rotateMatrix(vector<vector<int> > mat, int n) { ...
C++
2022-02-21
0
240
题解 | #最长回文子串#
注意最长回文子串和最长回文子序列的差别!!! class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param A string字符串 * @...
C++
2022-02-21
0
297
题解 | #对称的二叉树#
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(N...
C++
2022-02-21
0
298
题解 | #求二叉树的层序遍历#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
C++
2022-02-21
0
342
题解 | #二叉树的最大深度#
使用栈来实现 /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), ...
C++
2022-02-21
0
251
题解 | #二叉树的最大深度#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
C++
2022-02-21
0
227
题解 | #重建二叉树#
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x),...
C++
2022-02-21
0
286
题解 | #将升序数组转化为平衡二叉搜索树#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * ...
C++
2022-02-21
0
302
首页
上一页
7
8
9
10
11
12
13
14
15
16
下一页
末页