首页
学习
活动
专区
工具
TVP
发布

X

专栏作者
194
文章
118770
阅读量
23
订阅数
【操作系统真象还原】Mac安装配置bochs
需要本机提前装有gcc, sdl, gtk+, libxrandr软件包,否则make编译时会报错
SL_World
2022-05-06
1.7K0
Mac终端主题文字修改
链接:https://github.com/altercation/solarized
SL_World
2022-05-06
1.9K0
Mac重装Homebrew
由于在更新brew时遇到问题,因此决定重装brew 1. 卸载原有brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 中间可能需要输入密码,忽略可能出现的warning,直到最后卸载成功 ? 2. 安装新的brew /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/ma
SL_World
2022-05-06
5.1K0
Python矩阵求逆报错之TypeError: No loop matching the specified signature and casting...
先吐槽两句,真的是Matlab才不会报这种错,今天计算逆矩阵报了个这么个错,一个简单的2*2的可逆矩阵居然死活求不出来,好气啊。
SL_World
2022-05-06
8310
LaTeX两张图并排显示
切记\subfigure之外如果加了\centering两幅图就不会并列了,需要加在\subfigure之内。
SL_World
2022-05-06
2.9K0
MarkDown表格常用语法积累
-: 设置内容和标题栏居右对齐。 :- 设置内容和标题栏居左对齐。 :-: 设置内容和标题栏居中对齐。
SL_World
2022-05-06
7390
Python3使用winreg模块操作注册表
具体代码如下,可访问用户账户列表: 该设置位于HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
SL_World
2022-05-06
7870
Leetcode|固定四角从外围至内围|54. 螺旋矩阵
? ? 1 模拟 ? class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> res; int rowlen = matrix.size(); // 行数 int collen = matrix[0].size(); // 列数 int left = 0, right = collen - 1,
SL_World
2022-01-10
2250
Leetcode|找单链表中点+链表反转+链表合并|143. 重排链表
? 1 寻找单链表中点 + 链表反转 + 链表合并 这道题是道综合题,把三个知识点串起来,非常适合复习链表处理的三个技巧 【思路】:观察发现可以把链表后一半进行反转,然后当成两个链表的合并任务即可 class Solution { public: void reorderList(ListNode* head) { if (!head) return; // 1.寻找链表中点(快慢指针) auto premid = findmid(head);
SL_World
2022-01-10
3850
Leetcode|BFS每层最后1个节点|199. 二叉树的右视图
? 1 BFS每层最后1个节点添加到解中 思路: 利用 BFS 进行层次遍历,记录下每层的最后一个元素 ? class Solution { public: vector<int> rightSideView(TreeNode* root) { if (!root) return {}; vector<int> res; queue<TreeNode*> q; q.push(root); while (!q.empty(
SL_World
2022-01-10
1670
Leetcode|BFS+DFS拓扑排序|210. 课程表 II
? 1 BFS拓扑排序 class Solution { public: vector<vector<int>> edges; // 邻接矩阵 vector<int> indegree; // 入度表 vector<int> res; vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) { edges.resize(numCou
SL_World
2022-01-10
1790
Leetcode|索引置换|41. 缺失的第一个正数
腾讯秋招提前批AI Lab一面面试题 ? 1 原地数组索引置换 [3, 4, -1, 1] => [1, -1, 3, 4],这样遍历到nums[1] != 2就返回缺失的2 class Solution { public: int firstMissingPositive(vector<int>& nums) { int size = nums.size(); // 1.遇到与索引+1不同的数就置换,如[3,4,-1,1],其中nums[0] = 3 ≠ 0 + 1
SL_World
2022-01-10
2210
Leetcode|有序数组合并|4. 寻找两个正序数组的中位数
? ? 1 有序数组合并 class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { vector<int> merge; int size1 = nums1.size(); int size2 = nums2.size(); int sizem = size1 + size2; int
SL_World
2022-01-10
4660
Leetcode|小根堆|23. 合并K个升序链表
文章目录 1 两两链表合并(超时) 2 将K个链表首个节点依次压入小根堆,然后逐个弹出 ? ? 1 两两链表合并(超时) class Solution { public: ListNode* merge2Lists(ListNode* l1, ListNode* l2) { auto prehead = new ListNode(); auto merge = prehead; while (l1 || l2) { if (!l
SL_World
2022-01-10
2470
Leetcode|从后向前找首对升序对再交换右侧数并升序|31. 下一个排列
其中nums[left] = 5,即left = 4 然后找到left右侧最小的比5大的数的索引,即nums[right] = 6, right = 6
SL_World
2022-01-10
2190
Leetcode|区间首尾元素大小判断成序+二分查找|33. 搜索旋转排序数组
? 1 旋转数组的二分查找 ? 在二分搜索基础上,判断左右区间中的收尾元素大小,来判断是否成序,不成序或target在这个区间则搜索,否则搜索另外一个区间 class Solution { public: int search(vector<int>& nums, int target) { int size = nums.size(); int left = 0, right = size - 1; while (left <= right) {
SL_World
2022-01-10
2660
Leetcode|取余+数组翻转|189. 旋转数组
? 1 数组翻转— 空间复杂度, 时间复杂度 ? class Solution { public: void reverse(vector<int>& nums, int left, int right) { while (left < right) { swap(nums[left], nums[right]); left++; right--; } } void rotate(vector<
SL_World
2022-01-10
5660
Leetcode|数组上下翻转+主对角线翻转|48. 旋转图像
? ? 1 数组上下翻转+主对角线翻转 ? class Solution { public: void rotate(vector<vector<int>>& matrix) { int size = matrix.size(); // 1.上下翻转 for (int j = 0; j < size; j++) for (int i = 0; i < size / 2; i++) swap(ma
SL_World
2022-01-10
2690
Leetcode|二分+缩小左右区间去重|81. 搜索旋转排序数组 II
对于nums[left] == nums[mid] == nums[right]情况,如nums=[3,1,2,3,3,3,3], target=2 nums[0] == nums[3] == nums[6] == 3,无法判断该搜索左侧区域还是右侧区域,一个简单的想法是同时缩小左右侧区域
SL_World
2022-01-10
2010
Leetcode|入栈+出栈实现队列|剑指 Offer 09. 用两个栈实现队列
《225. 用两个队列实现栈》 《剑指 Offer 09. 用两个栈实现队列》 ? 1 入栈+出栈实现队列 ? 一个栈用于入队,一个栈用于出队操作 class CQueue { public: stack<int> stk1, stk2; // stk1用于入队,stk2用于出队 CQueue() { while (!stk1.empty()) stk1.pop(); while (!stk2.empty()) stk2.pop(); }
SL_World
2022-01-10
3100
点击加载更多
社区活动
RAG七天入门训练营
鹅厂大牛手把手带你上手实战
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com