Frame

  • Appendix
    • 【力扣】链表问题总结
    • 【力扣】c++中常用命令--菜鸟专用
  • 7天32题计划【点击加入计划】
  • 代码
    • 217. 存在重复元素
    • 53. 最大子序和
    • 1. 两数之和
    • 88. 合并两个有序数组
    • 350. 两个数组的交集 II
    • 121. 买卖股票的最佳时机
    • 566. 重塑矩阵
    • 118. 杨辉三角
    • 36. 有效的数独
    • 73. 矩阵置零
    • 387. 字符串中的第一个唯一字符
    • 383. 赎金信
    • 242. 有效的字母异位词
    • 141. 环形链表
    • 21. 合并两个有序链表
    • 203. 移除链表元素
    • 206. 反转链表
    • 83. 删除排序链表中的重复元素
    • 20. 有效的括号
    • 232. 用栈实现队列
    • 144. 二叉树的前序遍历
    • 94. 二叉树的中序遍历
    • 145. 二叉树的后序遍历
    • 102. 二叉树的层序遍历
    • 104. 二叉树的最大深度
    • 101. 对称二叉树
    • 226. 翻转二叉树
    • 112. 路径总和
    • 700. 二叉搜索树中的搜索
    • 701. 二叉搜索树中的插入操作
    • 98. 验证二叉搜索树
    • 653. 两数之和 IV - 输入 BST
    • 235. 二叉搜索树的最近公共祖先

Appendix

【力扣】链表问题总结

【力扣】c++中常用命令–菜鸟专用

7天32题计划【点击加入计划】

题目 难度 描述 类型 思路
217. 存在重复元素 简单 给定一个整数数组,判断是否存在重复元素。如果存在一值出现至少两次,函数返回 true 数组
哈希表
排序
a. 先排序,然后顺序查一遍;
b. 使用数据结构 hash 表;
53. 最大子序和 简单 返回一个整数数组最大和的连续子数组的和 数组
分治
动态规划
dp[i]代表着以nums[i]结尾的最大的子序列和;
1. 两数之和 简单 数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标 数组
哈希表
构造 hash 表,反向查找 target - num,找到返回地址,没找到则插入;
88. 合并两个有序数组 简单 将 nums2 合并到 nums1 中,使 nums1 成为一个有序数组 数组
双指针
排序
a. <自写>三个指针相互替换;
b. 使用 swap;
350. 两个数组的交集 II 简单 编写一个函数来计算两个数组的交集 数组
哈希表
双指针
二分查找
a. 使用双指针来查找相同的列表;
b. 使用 unodered_map 来计数数值的个数:
121. 买卖股票的最佳时机 简单 一天买入,不同的一天卖出,计算可能的最大利润 数组
动态规划
a. 转化为最大子序和来做;
b. 动态规划,dp[i]为以nums[i]结尾的最大收益;
c. 计算每次到当天的最小股票价格和最大利润;
d. 明确 dp(i)表示什么(二维:dp(i)(j))
566. 重塑矩阵 简单 reshape重塑矩阵 数组
矩阵
模拟
a. 遍历元素,tmp满足维度加入清空;
b. 找到对应位置读取
118. 杨辉三角 简单 给一个非负整数,生成「杨辉三角」的前 n 行 数组
动态规划
动态初始化数组的规模,递归填入
36. 有效的数独 中等 根据规则判断 9x9 的数独是否有效 数组
哈希表
矩阵
a. 复杂度为 n * n, 建立5个hash;
b. 使用数组 hash[9][10]={0} 确定box index
73. 矩阵置零 中等 矩阵中将0所在行和列的所有元素都设为 0 数组
哈希表
矩阵
a. 使用两个标记数组;
b. 使用两个标记变量;
c. 使用一个标记变量
387. 字符串中的第一个唯一字符 简单 找到字符串第一个不重复的字符,返回索引 队列
哈希表
字符串
计数
a. 使用哈希表存储频数;
b. 使用哈希表存储索引;
c. 队列
383. 赎金信 简单 字符串 s1 是否能由字符串 s2 里面的字符构成 哈希表
字符串
计数
a. 排序加双指针;
b. 使用 hash
242. 有效的字母异位词 简单 字母异位词:两字符串每个字符出现的次数都相同 哈希表
字符串
排序
a. 使用排序,string ==;
b. 使用 hash
141. 环形链表 简单 给定一个链表,判断链表中是否有环。 哈希表
链表
双指针
a. 链表主要代码;
b. hash 表存储
21. 合并两个有序链表 简单 两个升序链表合并为一个新的 升序 链表并返回 递归
链表
a. 递归方法;
b. 迭代方法
203. 移除链表元素 简单 删除链表中所有满足 Node.val == val 的节点 递归
链表
a. 递归:终止条件是 head 为空;
b. 建立哑结点、当前节点
206. 反转链表 简单 返回反转后的链表。 递归
链表
a. 使用指针vector,保存每一个指针;
b. 迭代反转链表
c. 递归,确定截止条件和假设后面修改完
83. 删除排序链表中的重复元素 简单 删除升序链表所有重复的元素 链表 a. 迭代;
b. 递归;
20. 有效的括号 简单 判断括号字符串是否有效
字符串
a. 使用 vector 充当栈;
b. 标准栈,并使用 map 匹配括号
232. 用栈实现队列 简单 用栈实现队列
设计
队列
一个输入栈push,一个输出栈pop、peek
144. 二叉树的前序遍历 简单 返回二叉树的前序遍历

深度优先搜索
二叉树
a. 递归;
b. 通过栈完成递归;
c. 通过栈隐式完成迭代;
d. Morris 遍历
94. 二叉树的中序遍历 简单 返回二叉树的中序遍历

深度优先搜索
二叉树
a. 递归;
b. 通过栈隐式完成迭代;
c. Morris 遍历
145. 二叉树的后序遍历 简单 返回二叉树的中序遍历

深度优先搜索
二叉树
a. 递归;
b. 通过栈隐式完成迭代;
c. Morris 遍历
102. 二叉树的层序遍历 中等 返二叉树按层序遍历得到的节点值
广度优先搜索
二叉树
构造队列广度遍历
104. 二叉树的最大深度 简单 给定一个二叉树,找出其最大深度
深度优先搜索
广度优先搜索
a. 构造队列广度遍历
b. 递归计算max(l,r)+1
101. 对称二叉树 简单 给定一个二叉树,检查它是否是镜像对称的。
深度优先搜索
广度优先搜索
a. 双指针同步移动递归
b. 双指针同步移动迭代
226. 翻转二叉树 简单 翻转一棵二叉树。
深度优先搜索
广度优先搜索
递归翻转
112. 路径总和 简单 根节点到叶子节点 的路径节点值和等于targetSum
深度优先搜索
二叉树
a. 递归
b. 迭代
700. 二叉搜索树中的搜索 简单 给定二搜(BST)和一个值。 需在BST中找到节点值等于给定值的节点。 返回以该节点为根的子树。 如节点不存在返NULL。
二叉搜索树
二叉树
a. 非BST递归
b. 递归
c. 迭代
701. 二叉搜索树中的插入操作 中等 给定二叉搜索树(BST)的根节点和要插入树中的值,将值插入二叉搜索树
二叉搜索树
二叉树
a. 递归
b. 迭代
98. 验证二叉搜索树 中等 给定一个二叉树,判断其是否是一个有效的二叉搜索树。
深度优先搜索
二叉搜索树
a. 递归01
==b.==递归02
c. 中序遍历迭代
653. 两数之和 IV - 输入 BST 简单 给定一个BST 和 k,BST 中存在两个元素且和等于 k ,则返回 true
深度优先搜索
广度优先搜索
a. 使用 HashSet【通过】
b. 使用 BFS 和 HashSet【通过】
c. 方法三:使用 BST【通过】
235. 二叉搜索树的最近公共祖先 简单 给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先。
深度优先搜索
二叉搜索树
a. 两次遍历,两个数组
b. 一次遍历,两个指针
c. 一次遍历,一起找

代码

217. 存在重复元素

// a.
class Solution {public:bool containsDuplicate(vector<int>& nums) {sort(nums.begin(), nums.end());int n = nums.size();for(int i = 0; i < n - 1; i++){if(nums[i] == nums[i+1]){return true;}}return false;}
};
// b.
class Solution {public:bool containsDuplicate(vector<int>& nums) {unordered_set<int> s;for(int x: nums){if (s.find(x) != s.end()){return true;}s.insert(x);}return false;}
};

53. 最大子序和

class Solution {public:int maxSubArray(vector<int>& nums) {int max = nums[0];int sum = 0for (int num: nums){if (sum > 0){sum += num;}else{sum = num;}// 这里就不需要使用数组 dp 存放,然后再找最大值max = max > sum ? max : sum;}return max;}
};

1. 两数之和

class Solution {public:vector<int> twoSum(vector<int>& nums, int target) {map<int, int> a;vector<int> b(2, -1);for (int i=0; i < nums.size(); i++){if(a.find(target - nums[i]) != a.end()){//          if(a.count(target - nums[i]) > 0){b[0] = a[target - nums[i]];b[1] = i;break;}a[nums[i]] = i;}return b;}
};

88. 合并两个有序数组

// a.
class Solution {public:void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {int loc = m + n - 1;int loc1 = m - 1;int loc2 = n - 1;while(loc >= 0 && loc2 >= 0){while(loc1 >= 0 && nums1[loc1] >= nums2[loc2]){nums1[loc--] = nums1[loc1--];}while(loc1 == -1 && loc2 >= 0){nums1[loc--] = nums2[loc2--];}while(loc2 >= 0 && nums1[loc1] < nums2[loc2]){nums1[loc--] = nums2[loc2--];}}}
};
// b.
class Solution {public:void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {int l = m + n - 1;m--;n--;while(n >= 0){while(m >= 0 && nums1[m] > nums2[n]){swap(nums1[m--], nums1[l--]);}swap(nums2[n--], nums1[l--]);}}
};

350. 两个数组的交集 II

// a.
class Solution {public:vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {unordered_map<int,int> mp;for(int num: nums1)mp[num]++;vector<int> v;for(int num: nums2){if(mp.count(num) && mp[num] > 0){mp[num]--;v.push_back(num);}}return v;}
};
// b.
class Solution {public:vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {sort(nums1.begin(), nums1.end());sort(nums2.begin(), nums2.end());vector<int> v;int i=0, j=0;while(i<nums1.size() && j<nums2.size()){if(nums1[i] == nums2[j]){v.insert(v.begin(), nums1[i]);i++;j++;}else if(nums1[i] > nums2[j]){j++;}else{i++;}}return v;}
};

121. 买卖股票的最佳时机

class Solution {public:int maxProfit(vector<int>& prices) {vector<int> v;for(int i = 0; i < prices.size()-1;i++){v.push_back(prices[i+1] - prices[i]);}int sum = 0;int res = 0;for(int num:v){sum += num;sum = sum > num ? sum : num;res = res > sum ? res : sum;}return res;}
};
// b.
class Solution {public:int maxProfit(vector<int>& prices) {vector<int> v(prices.size());for(int i = 1; i < prices.size();i++){int tmp = v[i-1] + prices[i] - prices[i-1];v[i] = tmp > 0 ? tmp : 0;}return *max_element(v.begin(), v.end());}
};
// b 2.0.
class Solution {public:int maxProfit(vector<int>& prices) {int max_pro = 0;int last = 0;for(int i = 1; i < prices.size();i++){int tmp = last + prices[i] - prices[i-1];last = tmp > 0 ? tmp : 0;max_pro = tmp > max_pro ? tmp : max_pro;}return max_pro;}
};
// c.
class Solution {public:int maxProfit(vector<int>& prices) {int max_pro = 0;int min_price = prices[0];for(int i = 1; i < prices.size(); i++){min_price = min_price < prices[i] ? min_price : prices[i];max_pro = max_pro > prices[i] - min_price ? max_pro : prices[i] - min_price;}return max_pro;}
};

566. 重塑矩阵

// a.
class Solution {public:vector<vector<int>> matrixReshape(vector<vector<int>>& mat, int r, int c) {if (r * c != mat.size() * mat[0].size())return mat;vector<vector<int>> nmat;vector<int> tmp;for(auto rows: mat){for(auto i: rows){tmp.push_back(i);if(tmp.size() == c){nmat.push_back(tmp);tmp.clear();}}}return nmat;}
};
// b.
class Solution {public:vector<vector<int>> matrixReshape(vector<vector<int>>& mat, int r, int c) {int m = mat.size();int n = mat[0].size();if(m * n != r * c)return mat;vector<vector<int>> nmat(r, vector<int>(c));for(int x = 0; x < m * n; x++){nmat[x / c][x % c] = mat[x / n][x % n];}return nmat;}
};

118. 杨辉三角

// a.
class Solution {public:vector<vector<int>> generate(int numRows) {vector<vector<int>> v(numRows, vector<int>(2, 1));v[0].pop_back();for(int i = 2; i < numRows; i++){for(int j = 0; j < v[i-1].size() - 1; j++){v[i].insert(v[i].begin() + 1, v[i - 1][j] + v[i - 1][j + 1]);}}return v;}
};
// b.
class Solution {public:vector<vector<int>> generate(int numRows) {vector<vector<int>> v(numRows);for(int i = 0; i < numRows; i++){v[i].resize(i+1);v[i][0] = v[i][i] = 1;for(int j = 1; j < i; j++){v[i][j] = v[i-1][j] + v[i-1][j-1];}}return v;}
};

36. 有效的数独

// a.
class Solution {public:bool isValidSudoku(vector<vector<char>>& board) {int n = board.size();unordered_set<char> sr,s0,s1,s2,sc;for(int i = 0; i < n; i++){if (i % 3 == 0){s0.clear();s1.clear();s2.clear();}for(int j = 0; j < n; j++){// rowif (board[i][j] != '.'){if (sr.find(board[i][j]) == sr.end())sr.insert(board[i][j]);elsereturn false;}//columnsif (board[j][i] != '.'){if (sc.find(board[j][i]) == sc.end())sc.insert(board[j][i]);elsereturn false;}// 3 * 3if (board[i][j] != '.'){if(j / 3 == 0){if(s0.find(board[i][j]) == s0.end())s0.insert(board[i][j]);elsereturn false;}if(j / 3 == 1){if(s1.find(board[i][j]) == s1.end())s1.insert(board[i][j]);elsereturn false;}if(j / 3 == 2){if(s2.find(board[i][j]) == s2.end())s2.insert(board[i][j]);elsereturn false;}}}sr.clear();sc.clear();}return true;}
};
// a 2.0.
class Solution {public:bool isValidSudoku(vector<vector<char>>& board) {int sr[10] = {0};int sc[10] = {0};int s0[10] = {0};int s1[10] = {0};int s2[10] = {0};for(int i = 0; i < board.size(); i++){if (i % 3 == 0)for(int k = 0; k < 10; k++)s0[k] = s1[k] = s2[k] = 0;for(int j = 0; j < board.size(); j++){if(board[i][j] != '.'){int value = board[i][j] - '1';if(sr[value]) return false;// rowsr[value] = 1;// 3 * 3if(j / 3 == 0){if(s0[value]) return false;s0[value] = 1;}if(j / 3 == 1){if(s1[value]) return false;s1[value] = 1;}if(j / 3 == 2){if(s2[value]) return false;s2[value] = 1;}}if(board[j][i] == '.') continue;if(sc[board[j][i] - '1']) return false;//columnssc[board[j][i] - '1'] = 1;}for(int k = 0; k < 10; k++)sr[k] = sc[k] = 0;}return true;}
};
// b.
class Solution {public:bool isValidSudoku(vector<vector<char>>& board) {int row[9][10] = {0};int col[9][10] = {0};int box[9][10] = {0};for(int i = 0; i < board.size(); i++){for(int j = 0; j < board[0].size(); j++){if(board[i][j] == '.') continue;int b_index = j / 3 + (i / 3) * 3;int value = board[i][j] - '0';if(row[i][value]) return false;if(col[j][value]) return false;if(box[b_index][value]) return false;row[i][value] = 1;col[j][value] = 1;box[b_index][value] = 1;}}return true;}
};

73. 矩阵置零

// a.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {unordered_set<int> col;for(int i = 0; i < matrix.size(); i++){int row = 0;for(int j = 0; j < matrix[0].size(); j++){if(matrix[i][j] == 0){row = 1;col.insert(j);}}if (row)for (int j = 0; j < matrix[0].size(); j++)matrix[i].assign(matrix[0].size(),0);}for(int j:col)for(int i = 0; i < matrix.size(); i++)matrix[i][j] = 0;}
};
```cpp
// b.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {int k = -1;for(int i = 0; i < matrix.size(); i++){int row = 0;if (k == -1){for(int j = 0; j < matrix[0].size(); j++)if(matrix[i][j] == 0)row = 1;if (row)for(int j = 0; j < matrix[0].size(); j++){if(matrix[i][j] == 0){matrix[i][j] = 1;k = i;}elsematrix[i][j] = 0;}}else{for(int j = 0; j < matrix[0].size(); j++){if(matrix[i][j] == 0){row = 2;matrix[k][j] = 1;}}}if (row == 2)matrix[i].assign(matrix[0].size(),0);}if (k != -1)for(int j = 0; j < matrix[0].size(); j++){if (matrix[k][j])for(int i = 0; i < matrix.size(); i++)matrix[i][j] = 0;}}
};
// a 2.0.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {int m = matrix.size();int n = matrix[0].size();vector<int> row(m), col(n);for (int i = 0; i < m; i++){for (int j = 0; j < n; j++){if (!matrix[i][j]){row[i] = col[j] = true;}}}for (int i = 0; i < m; i++){for(int j = 0; j < n; j++){if(row[i] || col[j]){matrix[i][j] = 0;}}}}
};
// b 2.0.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {int m = matrix.size();int n = matrix[0].size();// flag_col0bool col = false, row = false;for (int i = 0; i < m; i++){if(!matrix[i][0]){col = true;break;}}for (int j = 0; j < n; j++){if (!matrix[0][j]){row = true;break;}}for (int i = 1; i < m; i++){for (int j = 1; j < n; j++){if (!matrix[i][j]){matrix[0][j] = matrix[i][0] = 0;}}}// 注意: 这里是不可以提前修改第0行和第0列的值for (int i = 1; i < m; i++){for (int j = 1; j < n; j++){if(!matrix[0][j] || !matrix[i][0]){matrix[i][j] = 0;}}}if (row){matrix[0].assign(n, 0);}if (col){for (int i = 0; i < m; i++){matrix[i][0] = 0;}}}
};
// b 3.0.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {int m = matrix.size();int n = matrix[0].size();int flag_col0 = false;for (int i = 0; i < m; i++) {if (!matrix[i][0]) {flag_col0 = true;}for (int j = 1; j < n; j++) {if (!matrix[i][j]) {matrix[i][0] = matrix[0][j] = 0;}}}for (int i = m - 1; i >= 0; i--) {for (int j = 1; j < n; j++) {if (!matrix[i][0] || !matrix[0][j]) {matrix[i][j] = 0;}}if (flag_col0) {matrix[i][0] = 0;}}}
};
// b 3.1.
class Solution {public:void setZeroes(vector<vector<int>>& matrix) {int m = matrix.size();int n = matrix[0].size();bool col0 = false;for (int i = 0; i < m; i++){if (!matrix[i][0]){col0 = true;break;}}for (int i = 0; i < m; i++){for (int j = 1; j < n; j++){if(!matrix[i][j]){matrix[i][0] = matrix[0][j] = 0;}}}for (int i = 1; i < m; i++){for (int j = 1; j < n; j++){if(!matrix[i][0] || !matrix[0][j]){matrix[i][j] = 0;}}}if (!matrix[0][0]){matrix[0].assign(n, 0);}if (col0){for (int i = 0; i < m; i++){matrix[i][0] = 0;}}}
};

387. 字符串中的第一个唯一字符

// a.
class Solution {public:int firstUniqChar(string s) {unordered_map<char, int> mp;for (char ch: s){mp[ch]++;}for (int i = 0; i < s.size(); i++){if (mp[s[i]] == 1)return i;}return -1;}
};
// b.
class Solution {public:int firstUniqChar(string s) {unordered_map<char, int> mp;for (int i = 0; i < s.size(); i++){if(mp.find(s[i]) != mp.end())mp[s[i]] = -1;elsemp[s[i]] = i;}for (int i = 0; i < s.size(); i++){if (mp[s[i]] != -1)return mp[s[i]];}return -1;}
};
// b. 2.0.
class Solution {public:int firstUniqChar(string s) {int n = s.size();unordered_map<char, int> mp;for (int i = 0; i < n; i++){if (mp.count(s[i])){mp[s[i]] = -1;}else{mp[s[i]] = i;}}int first = n;for (auto [_, loc]: mp){if(loc != -1 && loc < first){first = loc;}}if (first == n){first = -1;}return first;}
};
// c.
class Solution {public:int firstUniqChar(string s) {int n = s.size();unordered_map<char, int> mp;queue<pair<char, int>> q;for (int i = 0; i < n; i++){if (!mp.count(s[i])){mp[s[i]] = i;q.emplace(s[i], i);}else{mp[s[i]] = -1;while(!q.empty() && mp[q.front().first] == -1){q.pop();}}}return q.empty() ? -1 : q.front().second;}
};

383. 赎金信

class Solution {public:bool canConstruct(string ransomNote, string magazine) {sort(ransomNote.begin(), ransomNote.end());sort(magazine.begin(), magazine.end());int loc = 0;int m = magazine.size();int n = ransomNote.size();for (int i = 0; i < m; i++){if (loc > n - 1)break;if (magazine[i] <= ransomNote[loc]){if (magazine[i] == ransomNote[loc]){loc++;}}else{break;}}if (loc == n)return true;return false;}
};
// b. 1.0.
class Solution {public:bool canConstruct(string ransomNote, string magazine) {unordered_map<char, int> mp;for (char ch: ransomNote){mp[ch]++;}for (char ch: magazine){if (mp.empty()){return true;}if (mp.count(ch)){mp[ch]--;if (!mp[ch]){mp.erase(ch);}}}if (mp.empty()){return true;}return false;}
};
// b. 2.0.
class Solution {public:bool canConstruct(string ransomNote, string magazine) {int countRN[26] = {0};for(char ch: ransomNote){countRN[ch - 'a']++;}for(char ch: magazine){countRN[ch - 'a']--;}for(auto i: countRN){if(i > 0)return false;}return true;}
};

242. 有效的字母异位词

// a.
class Solution {public:bool isAnagram(string s, string t) {int count[26] = {0};for (char ch: s)count[ch - 'a']++;for (char ch: t)count[ch - 'a']--;for (int i: count){if (i != 0)return false;}return true;}
};
// a. 2.0.
class Solution {public:bool isAnagram(string s, string t) {if (s.size() != t.size())return false;int count[26] = {0};for (char ch: s)count[ch - 'a']++;for (char ch: t){count[ch - 'a']--;if (count[ch - 'a'] < 0)return false;}return true;}
};
class Solution {public:bool isAnagram(string s, string t) {if (s.size() != t.size())return false;sort(s.begin(), s.end());sort(t.begin(), t.end());return s==t;}
};

141. 环形链表

//a.
#include <bits/stdc++.h>
using namespace std;//定义一个结点模板
template<typename T>
struct Node {T data;Node *next;Node() : next(nullptr) {}Node(const T &d) : data(d), next(nullptr) {}
};//删除 p 结点后面的元素
template<typename T>
void Remove(Node<T> *p) {if (p == nullptr || p->next == nullptr) {return;}auto tmp = p->next->next;delete p->next;p->next = tmp;
}//在 p 结点后面插入元素
template<typename T>
void Insert(Node<T> *p, const T &data) {auto tmp = new Node<T>(data);tmp->next = p->next;p->next = tmp;
}//遍历链表
template<typename T, typename V>
void Walk(Node<T> *p, const V &vistor) {while(p != nullptr) {vistor(p);p = p->next;}
}int main() {auto p = new Node<int>(1);Insert(p, 2);int sum = 0;Walk(p, [&sum](const Node<int> *p) -> void { sum += p->data; });cout << sum << endl;Remove(p);sum = 0;Walk(p, [&sum](const Node<int> *p) -> void { sum += p->data; });cout << sum << endl;return 0;
}
// b.
class Solution {public:bool hasCycle(ListNode *head) {unordered_set <ListNode *> s;while (head != nullptr){if (s.count(head)){return true;}s.insert(head);head = head -> next;}return false;}
};
// c.
class Solution {public:bool hasCycle(ListNode *head) {ListNode* fastp = head;ListNode* slowp = head;while (fastp != nullptr){fastp = fastp->next;if (fastp != nullptr){fastp = fastp->next;}if (fastp == slowp){return true;}slowp = slowp->next;}return false;}
};

21. 合并两个有序链表

 // a./*** Definition for singly-linked list.* struct ListNode {*     int val;*     ListNode *next;*     ListNode() : val(0), next(nullptr) {}*     ListNode(int x) : val(x), next(nullptr) {}*     ListNode(int x, ListNode *next) : val(x), next(next) {}* };*/
class Solution {public:ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {ListNode* prehead = new ListNode(-1);ListNode* prev = prehead;while (l1 != nullptr && l2 != nullptr){if (l1->val < l2->val){prev->next = l1;l1 = l1->next;}else{prev->next = l2;l2 = l2->next;}prev = prev->next;}prev->next = l1 != nullptr ? l1 : l2;return prehead->next;}
};
// b.
class Solution {public:ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {if (l1 == nullptr){return l2;}else if (l2 == nullptr){return l1;}else if (l1->val < l2->val){l1->next = mergeTwoLists(l1->next, l2);return l1;}else{l2->next = mergeTwoLists(l1, l2->next);return l2;}}
};

203. 移除链表元素

// a.
/*** Definition for singly-linked list.* struct ListNode {*     int val;*     ListNode *next;*     ListNode() : val(0), next(nullptr) {}*     ListNode(int x) : val(x), next(nullptr) {}*     ListNode(int x, ListNode *next) : val(x), next(next) {}* };*/
class Solution {public:ListNode* removeElements(ListNode* head, int val) {if (head == nullptr)return nullptr;if (head->val == val){return removeElements(head->next, val);}head->next = removeElements(head->next, val);return head;}
};
// a. 2.0
class Solution {public:ListNode* removeElements(ListNode* head, int val) {if (head == nullptr)return head;head->next = removeElements(head->next, val);return head->val == val ? head->next : head;}
};
// b.
class Solution {public:ListNode* removeElements(ListNode* head, int val) {struct ListNode* dummyHead = new ListNode(0, head);struct ListNode* temp = dummyHead;while (temp->next != nullptr){if (temp->next->val == val){temp->next = temp->next->next;}else{temp = temp->next;}}return dummyHead->next;}
};

206. 反转链表

// a.
/*** Definition for singly-linked list.* struct ListNode {*     int val;*     ListNode *next;*     ListNode() : val(0), next(nullptr) {}*     ListNode(int x) : val(x), next(nullptr) {}*     ListNode(int x, ListNode *next) : val(x), next(next) {}* };*/
class Solution {public:ListNode* reverseList(ListNode* head) {if (head == nullptr)return head;vector<ListNode*> vnode;while(head != nullptr){vnode.push_back(head);head = head->next;}int n = vnode.size();head = vnode[n - 1];ListNode* temp = head;for(int i = n - 2; i >= 0; i--){temp->next = vnode[i];temp = temp->next;}temp->next = nullptr;return head;}
};
// b.
class Solution {public:ListNode* reverseList(ListNode* head) {ListNode* prev = nullptr;ListNode* temp = head;while(temp != nullptr){ListNode* next = temp->next;temp->next = prev;prev = temp;temp = next;}return prev;}
};
// c.
class Solution {public:ListNode* reverseList(ListNode* head) {if (head == nullptr or head->next == nullptr)return head;ListNode* rest = reverseList(head->next);head->next->next = head;head->next = nullptr;return rest;}
};

83. 删除排序链表中的重复元素

// a.
/*** Definition for singly-linked list.* struct ListNode {*     int val;*     ListNode *next;*     ListNode() : val(0), next(nullptr) {}*     ListNode(int x) : val(x), next(nullptr) {}*     ListNode(int x, ListNode *next) : val(x), next(next) {}* };*/
class Solution {public:ListNode* deleteDuplicates(ListNode* head) {ListNode* prev = head;if (head == nullptr){return head;}ListNode* curr = head->next;while(curr != nullptr){ListNode* next = curr->next;if (prev->val == curr->val){prev->next = next;curr = next;}else{prev = curr;curr = next;}}return head;}
};
// a. 2.0.
class Solution {public:ListNode* deleteDuplicates(ListNode* head) {if (head == nullptr)return head;ListNode* curr = head;while(curr->next){if(curr->val == curr->next->val){curr->next = curr->next->next;}else{curr = curr->next;}}return head;}
};
// b.
class Solution {public:ListNode* deleteDuplicates(ListNode* head) {if (head == nullptr || head->next == nullptr)return head;if (head->val == head->next->val){head->next = head->next->next;deleteDuplicates(head);}else {deleteDuplicates(head->next);}return head;}
};

20. 有效的括号

// a.
class Solution {public:bool isValid(string s) {vector<char> v;for (char ch: s){if (ch == '(' || ch == '[' || ch == '{'){v.push_back(ch);}else{int l = v.size() - 1;if (l < 0){return false;}if (ch == ')' and v[l] == '(' || ch == ']' and v[l] == '[' || ch == '}' and v[l] == '{'){v.pop_back();}else{return false;}}}if (!v.empty()){return false;}return true;}
};
// b.
class Solution {public:bool isValid(string s) {int n = s.size();if (n % 2 == 1)return false;unordered_map<char, char> match = {{'[', ']'},{'(', ')'},{'{', '}'},};stack<char> st;for(char ch: s){if (match.count(ch)){st.push(ch);}else{if (st.empty() || match[st.top()] != ch)return false;else    st.pop();}}return st.empty();}
};

232. 用栈实现队列

// a.
class MyQueue {private:stack<int> instack, outstack;void in2out(){while(!instack.empty()){outstack.push(instack.top());instack.pop();}}
public:/** Initialize your data structure here. */MyQueue() {}/** Push element x to the back of queue. */void push(int x) {instack.push(x);}/** Removes the element from in front of queue and returns that element. */int pop() {if (outstack.empty())in2out();int x = outstack.top();outstack.pop();return x;}/** Get the front element. */int peek() {if (outstack.empty())in2out();int x = outstack.top();return x;}/** Returns whether the queue is empty. */bool empty() {return instack.empty() && outstack.empty();}
};/*** Your MyQueue object will be instantiated and called as such:* MyQueue* obj = new MyQueue();* obj->push(x);* int param_2 = obj->pop();* int param_3 = obj->peek();* bool param_4 = obj->empty();*/

144. 二叉树的前序遍历

// a.
/*** Definition for a binary tree node.* struct TreeNode {*     int val;*     TreeNode *left;*     TreeNode *right;*     TreeNode() : val(0), left(nullptr), right(nullptr) {}*     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}*     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}* };*/
class Solution {public:void preorder(TreeNode *root, vector<int> &res){if(root == nullptr){return;}res.push_back(root->val);preorder(root->left, res);preorder(root->right, res);}vector<int> preorderTraversal(TreeNode* root) {vector<int> res;preorder(root, res);return res;}
};
// a. 2.0.
class Solution {public:vector<int> preorderTraversal(TreeNode* root) {vector<int> res;stack<TreeNode *> st;st.push(root);while(!st.empty()){TreeNode* tmp = st.top();st.pop();if (tmp == nullptr){continue;}else{st.push(tmp->right);st.push(tmp->left);res.push_back(tmp->val);}}return res;}
};
// b.
class Solution {public:vector<int> preorderTraversal(TreeNode* root) {vector<int> res;if (root == nullptr)return res;stack<TreeNode*> st;TreeNode* node = root;while(!st.empty() || node != nullptr){while(node != nullptr){res.emplace_back(node->val);st.emplace(node);node = node->left;}node = st.top();st.pop();node = node->right;}return res;}
};
// c.
class Solution {public:vector<int> preorderTraversal(TreeNode* root) {vector<int> res;if (root == nullptr){return res;}TreeNode *p1 = root, *p2 = nullptr;while (p1 != nullptr){p2 = p1->left;if (p2 != nullptr){while (p2->right != nullptr && p2->right != p1){p2 = p2->right;}if (p2->right == nullptr){p2->right = p1;res.emplace_back(p1->val);p1 = p1->left;continue;}else{p2->right = nullptr;}}else{res.emplace_back(p1->val);}p1 = p1->right;}return res;}
};

94. 二叉树的中序遍历

/*** Definition for a binary tree node.* struct TreeNode {*     int val;*     TreeNode *left;*     TreeNode *right;*     TreeNode() : val(0), left(nullptr), right(nullptr) {}*     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}*     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}* };*/
// a.
class Solution {public:void inorder(TreeNode* root, vector<int> &res){if (root == nullptr){return;}inorder(root->left, res);res.emplace_back(root->val);inorder(root->right, res);}vector<int> inorderTraversal(TreeNode* root) {vector<int> res;inorder(root, res);return res;}
};
// b.
class Solution {public:vector<int> inorderTraversal(TreeNode* root) {vector<int> res;stack<TreeNode*> stk;while (root != nullptr || !stk.empty()) {while (root != nullptr) {stk.push(root);root = root->left;}root = stk.top();stk.pop();res.push_back(root->val);root = root->right;}return res;}
};
// c.
class Solution {public:vector<int> inorderTraversal(TreeNode* root) {vector<int> res;TreeNode *p1 = root, *p2 = nullptr;while (p1 != nullptr){p2 = p1->left;if (p2 != nullptr){while (p2->right != nullptr && p2->right != p1){p2 = p2->right;}if (p2->right == nullptr){p2->right = p1;p1 = p1->left;continue;}else{res.emplace_back(p1->val);p2->right = nullptr;    }}else{res.emplace_back(p1->val);}p1 = p1->right;}return res;}
};

145. 二叉树的后序遍历

/*** Definition for a binary tree node.* struct TreeNode {*     int val;*     TreeNode *left;*     TreeNode *right;*     TreeNode() : val(0), left(nullptr), right(nullptr) {}*     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}*     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}* };*/
// a.
class Solution {public:void postorder(TreeNode* root, vector<int> &res){if (root == nullptr){return;}postorder(root->left, res);postorder(root->right, res);res.emplace_back(root->val);}vector<int> postorderTraversal(TreeNode* root) {vector<int> res;postorder(root, res);return res;}
};
// b.
class Solution {public:vector<int> postorderTraversal(TreeNode* root) {vector<int> res;if (root == nullptr){return res;}stack<TreeNode *> st;TreeNode * prev = nullptr;while (!st.empty() || root != nullptr){while (root != nullptr){st.emplace(root);root = root->left;}root = st.top();st.pop();if (root->right == nullptr || root->right == prev){res.emplace_back(root->val);prev = root;root = nullptr;}else{st.emplace(root);root = root->right;}}return res;}
};
// c.
class Solution {public:void addPath(vector<int> &res, TreeNode* node){int count = 0;while (node != nullptr){count ++;res.emplace_back(node->val);node = node->right;}reverse(res.end() - count, res.end());}vector<int> postorderTraversal(TreeNode* root) {vector<int> res;if (root == nullptr){return res;}TreeNode *p1 = root, *p2 = nullptr;while (p1 != nullptr){p2 = p1->left;if (p2 != nullptr){while(p2->right != nullptr && p2->right != p1){p2 = p2->right;}if (p2->right == nullptr){p2->right = p1;p1 = p1->left;  // #continue;}else{p2->right = nullptr;addPath(res, p1->left);}}p1 = p1->right;}addPath(res, root);return res;}
};

102. 二叉树的层序遍历

// a.
class Solution {public:vector<vector<int>> levelOrder(TreeNode* root) {vector<vector<int>> res;if (!root){return res;}queue<TreeNode*> q;q.emplace(root);while (!q.empty()){res.emplace_back(vector<int> ());int count = q.size();for(int i = 0; i < count; i++){root = q.front();q.pop();res.back().emplace_back(root->val);if (root->left){q.emplace(root->left);}if (root->right){q.emplace(root->right);}}}return res;}
};

104. 二叉树的最大深度

// a.
class Solution {public:int maxDepth(TreeNode* root) {int depth = 0;if (!root){return depth;}queue<TreeNode*> q;q.emplace(root);while(!q.empty()){int count = q.size();depth++;for(int i = 0; i < count; i++){root = q.front();q.pop();if (root->left){q.emplace(root->left);}if (root->right){q.emplace(root->right);}}}return depth;}
};
// a. 2.0
class Solution {public:int maxDepth(TreeNode* root) {if (root == nullptr) return 0;queue<TreeNode*> Q;Q.push(root);int ans = 0;while (!Q.empty()) {int sz = Q.size();while (sz > 0) {TreeNode* node = Q.front();Q.pop();if (node->left) Q.push(node->left);if (node->right) Q.push(node->right);sz -= 1;}ans += 1;} return ans;}
};
// b.
class Solution {public:int maxDepth(TreeNode* root) {if (!root){return 0;}return max(maxDepth(root->left), maxDepth(root->right)) + 1;}
};

101. 对称二叉树

// a.
class Solution {public:bool check(TreeNode* left, TreeNode* right){if (!left && !right){return true;}if (!left || !right){return false;}return left->val == right->val && check(left->left, right->right) && check(left->right, right->left);}bool isSymmetric(TreeNode* root) {return check(root, root);}
};
// b.
class Solution {public:bool isSymmetric(TreeNode* root) {queue<TreeNode*> q;q.emplace(root);q.emplace(root);TreeNode *node;while(q.size()%2 == 0 && q.size() > 0){root = q.front();q.pop();node = q.front();q.pop();if (!root && !node){continue;}if ((!root || !node) || (root->val != node->val)){return false;}q.emplace(root->left);q.emplace(node->right);q.emplace(root->right);q.emplace(node->left);}return true;}
};

226. 翻转二叉树

// a.
class Solution {public:TreeNode* invertTree(TreeNode* root) {if (!root){return root;}TreeNode *right = invertTree(root->right);TreeNode *left = invertTree(root->left);root->right = left;root->left = right;return root;}
};

112. 路径总和

// a.
class Solution {public:bool hasPathSum(TreeNode* root, int targetSum) {if (!root){return false;}if (!root->left && !root->right){return targetSum == root->val;}return hasPathSum(root->left, targetSum - root->val) || hasPathSum(root->right, targetSum - root->val);}
};
// b.
class Solution {public:bool hasPathSum(TreeNode* root, int targetSum) {if (!root){return false;}queue<TreeNode*> q_node;queue<int> q_val;q_node.emplace(root);q_val.emplace(root->val);while(!q_node.empty()){int tmp = q_val.front();root = q_node.front();q_val.pop();q_node.pop();if (!root->left && !root->right){if (targetSum == tmp){return true;}continue;}if (root->left){q_node.emplace(root->left);q_val.emplace(tmp + root->left->val);}if (root->right){q_node.emplace(root->right);q_val.emplace(tmp + root->right->val);}}return false;}
};

700. 二叉搜索树中的搜索

// a.
class Solution {public:TreeNode* searchBST(TreeNode* root, int val) {if (!root){return nullptr;}if (root->val == val){return root;}TreeNode *left = searchBST(root->left, val);TreeNode *right = searchBST(root->right, val);if (left){return left;}if (right){return right;}return nullptr;}
};
// b.
class Solution {public:TreeNode* searchBST(TreeNode* root, int val) {if (!root){return nullptr;}if (root->val == val){return root;}else if (root->val < val){root = searchBST(root->right, val);}else{root = searchBST(root->left, val);}return root;}
};
// c.
class Solution {public:TreeNode* searchBST(TreeNode* root, int val) {if (!root){return nullptr;}while (root != nullptr){if (root->val == val){return root;}else if (root->val > val){root = root->left;}else{root = root->right;}}return root;}
};

701. 二叉搜索树中的插入操作

// a.
class Solution {public:// void inorder(TreeNode* root, int val){// }TreeNode* insertIntoBST(TreeNode* root, int val) {if (!root){TreeNode *p = new TreeNode(val);return p;}if (root->val < val){root->right = insertIntoBST(root->right, val);}else{root->left = insertIntoBST(root->left, val);}return root;}
};
// b.
class Solution {public:TreeNode* insertIntoBST(TreeNode* root, int val) {if (!root){return new TreeNode(val);}TreeNode *cur = root;while(cur != nullptr){if (cur->val > val){if (cur->left){cur = cur->left;}else{cur->left = new TreeNode(val);break;}}else{if (cur->right){cur = cur->right;}else{cur->right = new TreeNode(val);break;}}}return root;}
};

98. 验证二叉搜索树

// a.
class Solution {public:bool left(TreeNode* node){int val = node->val;node = node->left;while(node->right){node = node->right;}return val > node->val;}bool right(TreeNode* node){int val = node->val;node = node->right;while(node->left){node = node->left;}return val < node->val;}bool isValidBST(TreeNode* root) {if (!root || !root->left && !root->right){return true;}if (!root->left){return right(root) && isValidBST(root->right);}if (!root->right){return left(root) && isValidBST(root->left);}return (right(root)) && (left(root)) && isValidBST(root->left) && isValidBST(root->right);}
};
// a. 2.0.
class Solution {public:bool helper(TreeNode* node, long long lower, long long upper){if (node == nullptr){return true;}if (node->val <= lower || node->val >= upper){return false;}return helper(node->left, lower, node->val) && helper(node->right, node->val, upper);}bool isValidBST(TreeNode* root) {return helper(root, LONG_MIN, LONG_MAX);}
};
// b.
class Solution {public:bool isValidBST(TreeNode* root) {stack<TreeNode*> st;long long pre = LONG_MIN;while(!st.empty() || root != nullptr){while (root != nullptr){st.emplace(root);root = root->left;}root = st.top();st.pop();if (root->val > pre){pre = root->val;root = root->right;}else{return false;}}return true;}
};

653. 两数之和 IV - 输入 BST

// a.
class Solution {public:bool Iteratefind(TreeNode* root, int k, unordered_set<int> &s){if (root == nullptr){return false;}if (s.find(k - root->val) != s.end()){return true;}s.insert(root->val);return Iteratefind(root->left, k, s) || Iteratefind(root->right, k, s);}bool findTarget(TreeNode* root, int k) {unordered_set<int> s;return Iteratefind(root, k, s);}
};
// b.
class Solution {public:bool findTarget(TreeNode* root, int k) {if (root == nullptr){return false;}unordered_set<int> hashset;queue<TreeNode*> nodeque;nodeque.emplace(root);while (!nodeque.empty()){TreeNode * curr = nodeque.front();nodeque.pop();if (curr == nullptr){continue;}if (hashset.find(k - curr->val) != hashset.end()){return true;}hashset.emplace(curr->val);nodeque.emplace(curr->left);nodeque.emplace(curr->right);}return false;}
};
// c.
class Solution {public:void inorder(TreeNode * root, vector<int> &res){if (root == nullptr){return;}inorder(root->left, res);res.push_back(root->val);inorder(root->right, res);}bool findTarget(TreeNode* root, int k) {vector<int> res;inorder(root, res);int l = 0;int r = res.size() - 1;while(l < r){if (res[l] + res[r] == k){return true;}else if (res[l] + res[r] < k){l++;}else{r--;}}return false;}
};

235. 二叉搜索树的最近公共祖先

// a.
class Solution {public:vector<TreeNode*> findpath(TreeNode* root, TreeNode* target){TreeNode* node = root;vector<TreeNode*> path;while(node != target){path.push_back(node);if (node->val < target->val){node = node->right;}else{node = node->left;}}path.push_back(target);return path;}TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {if (p->val == q->val){return p;}vector<TreeNode *> pf = findpath(root, p);vector<TreeNode *> qf = findpath(root, q);for (int i = 0; i < pf.size() && i < qf.size(); i++){if (pf[i] == qf[i]){root = pf[i];}}return root;}
};
// b.
class Solution {public:TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {TreeNode* nodeP = root;TreeNode* nodeQ = root;TreeNode* ancestor = root;while(nodeP != p && nodeQ != q){if (nodeP->val < p->val){nodeP = nodeP->right;}else{nodeP = nodeP->left;}if (nodeQ->val < q->val){nodeQ = nodeQ->right;}else{nodeQ = nodeQ->left;}if (nodeQ == nodeP){ancestor = nodeQ;}}return ancestor;}
};

【力扣】数据结构入门【7天32题数据结构入门】相关推荐

  1. 一年半´力扣´练习生超详细总结(附数据结构+算法)

    一年半´力扣´练习生超详细总结(附数据结构+算法) 文章目录 一年半´力扣´练习生超详细总结(附数据结构+算法) 我与力扣 数据结构 算法 未来计划 其他专栏推荐 我与力扣 专栏导航:LeetCode ...

  2. 力扣(简单+中等)50题整理总结

    文章目录 前言 一.简单题 1. 两数之和 7. 整数反转 9. 回文数 13. 罗马数字转整数 14. 最长公共前缀 20. 有效的括号 21. 合并两个有序链表 26. 删除有序数组中的重复项 2 ...

  3. 力扣题目归类,顺序刷题不再难

    目录 介绍 前奏-基础篇 中篇-链表.树的相关操作 进阶-回溯.动态规划 脑筋急转弯 介绍 大家好,相信很多人都知道刷力扣的重要性,但是如果不能将题目很好的归类整理专一练习,而是东做一道西做一道,那么 ...

  4. 力扣入门级广度优先搜索/遍历刷题小结

    刷这些题时死掉的脑细胞是我当年在<线性代数>和<概率论与数理统计>课上没学明白时苟活下来的( 这几题基本是抄作业了,但我发现官方题解写的也很绕,都不知道是我天然看到这类题就头晕 ...

  5. 力扣第303场周赛补题

    力扣 第三题:设计食物评分系统 示例 输入 ["FoodRatings", "highestRated", "highestRated", ...

  6. MySQL中改变相邻学生座位_力扣——换座位(数据库的题

    小美是一所中学的信息科技老师,她有一张 seat 座位表,平时用来储存学生名字和与他们相对应的座位 id. 其中纵列的 id 是连续递增的 小美想改变相邻俩学生的座位. 你能不能帮她写一个 SQL q ...

  7. 力扣第314场周赛补题

    1.题目:6200. 处理用时最长的那个任务的员工 - 力扣(LeetCode) 思路:两个数组记录处理时间与结果,通过遍历最长时间 class Solution { public:int harde ...

  8. 力扣(LeetCode)剑指offer刷题笔记(java),已完结!!!

    文章目录 3.数组中重复的数字 4.二维数组中的查找 5.替换空格 6.从尾到头打印链表 7.重建二叉树 9.两个栈来实现一个队列 10-1.斐波那契数列 10-2.跳台阶 11.旋转数组的最小数字 ...

  9. 力扣(LeetCode)怎么刷题,以排序算法为例

    掌握 LeetCode 刷题方法再开始刷题,属于磨刀不误砍柴工.掌握正确方法是非常重要的. 如果你在刷题的时候发现怎么也写不出来,别担心,这是正常的.如果你还发现,之前明明刷过的题,过段时间再做的时候 ...

最新文章

  1. 我艹,MySQL数据量大时,delete操作无法命中索引。
  2. 2021年春季学期-信号与系统-第十四次作业参考答案-第四小题参考答案
  3. sql count用法_SQL是一门手艺
  4. 常用的正则表达式的运用--学习笔记(二)
  5. 【加解密学习笔记:第二天】动态调试工具OllyDbg使用基础介绍
  6. Web前端笔记-element ui中table中禁止换行,使用...进行省略
  7. jenkins 持续集成, 使用sbt多项目同时package
  8. 用PHPMailer在本地win环境,可以接收到邮件和附件,但在linux环境只能接收邮件信息接不到附件,是我的路...
  9. 传三星Galaxy S10将推出Lite版本 搭载骁龙855处理器
  10. JVM学习-垃圾回收基础
  11. java 源树_【Java源码】树-概述
  12. 结构化思维:掌握这3点,分析报告不再愁
  13. 常用Docker 镜像命令(二)
  14. 34_注解的定义与反射调用
  15. 幻方矩阵(魔方矩阵)
  16. php字符串函数(1)长度计算、查找、截取
  17. 刷 百度排名,百度(google)搜索提示下拉关联词的一个简易思路··
  18. 计算机应用能力考试ppt,全国专业技术人员计算机应用能力考试 PPT 2003 题库版...
  19. 2018年年度总结-工作成长
  20. 4 Kubernetes资源-Pod控制器(2)

热门文章

  1. 日本动画现状“我是一个前动画师,有什么要问的”
  2. 如何快速更新网站内容
  3. 【一罐寡言】你的时间真的是不够用吗?
  4. 三分钟了解阿里云产品:对象存储OSS概述
  5. python统计字符频次_Python 统计长字符串中字符频次
  6. 一个简单的判断三角形形状的C程序
  7. 气象统计实习报告(不够熟练,程序冗杂)
  8. 【Scala】学习笔记三——面向对象
  9. VUE 数组性能优化以及踩雷
  10. 华为matepad10.4适配M-Pen2教程