31 1 分钟

# 2023/11/5 主板型号查看命令(cmd) msinfo32
38 1 分钟

# 安装 不推荐直接 wsl --install 直接安装,这样是在线装的带 gui 的。
1.2k 1 分钟

# 教程 https://c.biancheng.net/shell/ 命令的执行状态 和 命令的返回值(直接输出到标准输出上,下一行命令可以通过管道运算符从这个标准输出取出数据的么?) 这里补充了一下转义字符的相关知识,类似于制表符 \t 这种,输出在标准输出是多个字符的,但是在表示中是一个字符的。 【『教程』什么是转义字符?】...
19k 18 分钟

# 题目来源 https://noobdream.com//Major/article/56/#:~:text = 标签 %3A 华中科技大学历年机试真题精讲 学习人数 %3A 36.7k, 题库地址: http%3A%2F%2Fwww.noobdream.com%2FDreamJudge%2FContest%2F48%2F%23Problem http%3A%2F%2Fwww.noobdream.com%2FDreamJudge%2FContest%2F49%2F%23Problem 你可以在 DreamJudge...
2.8k 3 分钟

# 剑指 Offer 10- II. 青蛙跳台阶问题 class Solution {public: int numWays(int n) { if (n == 0) return 1; vector<int> dp(n + 1, 0); int num = 1e9 + 7; dp[0] = dp[1] = 1; for (int i = 2; i <= n; i++) { dp[i] = (dp[i - 1] + dp[i - 2]) % num; } return dp[n];...
3.1k 3 分钟

# 剑指 Offer 18. 删除链表的节点 struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(NULL) {}};class Solution {public: ListNode* deleteNode(ListNode* head, int val) { if (head == NULL) return NULL; ListNode* newRoot = new...
3.5k 3 分钟

# 剑指 Offer 07. 重建二叉树 dic 是树的结点值对在中序遍历的索引的映射 class Solution {public: TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder) { this->preorder = preorder; this->inorder = inorder; for (int i = 0; i < inorder.size(); i++)...
6.4k 6 分钟

# 剑指 Offer 28. 对称的二叉树 越过叶节点就是传入的指针为空。 class Solution {public: bool isSymmetric(TreeNode* root) { return root == nullptr || recur(root->left, root->right); }private: bool recur(TreeNode* L, TreeNode* R) { if(L == nullptr && R == nullptr)...
1.6k 1 分钟

# 剑指 Offer 03. 数组中重复的数字 int main() { map<int, int> mp; cout << mp[1] << endl; // 输出 0,同时将 & lt;1,0 > 插入了 if(mp.find(1) == mp.end()) { cout << "not find" << endl; }else{ cout...
6.1k 6 分钟

# 快速排序 int partition(vector<int>& nums, int l, int r) { // 以 nums [l] 作为基准数 int i = l, j = r; while (i < j) { while (i < j && nums[j] >= nums[l]) j--; while (i < j && nums[i] <= nums[l]) i++;...