上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: ###打开命令行terminal ctrl+alt+t ###复制粘贴 ctrl+shift+c ctrl+shift+v ####/usr/share/applications/ 这个文件夹可以创建桌面快捷方式 ###换源 1 备份修改 sudo cp sources.list sources.b 阅读全文
posted @ 2022-10-19 23:06 liv_vil 阅读(857) 评论(0) 推荐(0)
摘要: ##表 用户表 -- -- Table structure for table `user` -- USE dachuang; CREATE TABLE `user` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `username` VARCHAR(50) DEF 阅读全文
posted @ 2022-04-21 11:14 liv_vil 阅读(204) 评论(0) 推荐(1)
摘要: ##06. 从尾到头打印链表 class Solution { public: //两个指针一起走 一次翻转一个方向 最后head.next =null ListNode* reverse1(ListNode *head){ if(!head)return NULL; auto a=head,b=h 阅读全文
posted @ 2022-04-13 10:04 liv_vil 阅读(25) 评论(0) 推荐(1)
摘要: ##09. 用两个栈实现队列 没啥意思 不要想复杂了 就是暴力 class CQueue { public: CQueue() { } /* 一个主栈 一个缓存栈 来回导 得到队头 copy后一端变空了 */ stack<int>stk,cache; void copy(stack<int>&a,s 阅读全文
posted @ 2022-04-13 09:38 liv_vil 阅读(27) 评论(0) 推荐(0)
摘要: #初始化 数组初始化在class外的话 要memset 在主函数里面memset 在class内不用 ##062. 实现前缀树 class Trie { public: /** Initialize your data structure here. */ int son[100010][26],c 阅读全文
posted @ 2022-03-31 22:12 liv_vil 阅读(42) 评论(0) 推荐(0)
摘要: ##088. 爬楼梯的最少成本 class Solution { public: int minCostClimbingStairs(vector<int>& cost) { int n=cost.size(); vector<int>f(n+1); f[0]=cost[0],f[1]=cost[1 阅读全文
posted @ 2022-03-25 20:22 liv_vil 阅读(36) 评论(0) 推荐(0)
摘要: ##068. 查找插入位置 class Solution { public: int searchInsert(vector<int>& nums, int target) { int l=0,r=nums.size(); nums.push_back(1000000);//一定有数比target大 阅读全文
posted @ 2022-03-25 18:43 liv_vil 阅读(24) 评论(0) 推荐(0)
摘要: ##059. 数据流的第 K 大数值 class KthLargest { public: priority_queue<int,vector<int>,greater<int>>heap;//小根堆 维护第1大到第k大的数 top就是第k大的数 int k;//太妙了 /* 第n大 n-1 n-2 阅读全文
posted @ 2022-03-25 15:48 liv_vil 阅读(34) 评论(0) 推荐(0)
摘要: ##086. 分割回文子字符串 用substr枚举 因为是连续的 不是放与不放的问题 class Solution { public: vector<vector<string>>ans; vector<string>path; bool check() { for(string x:path) { 阅读全文
posted @ 2022-03-23 10:17 liv_vil 阅读(29) 评论(0) 推荐(0)
摘要: #我为什么要把代码粘在这里 断更很久了,基于一个错误的观念:我想看题,我到leetcode官网看不就行了吗? 但是若干年后我可能还会到我的博客园看看呀,我有可能上刷题网站吗?而且心得不好写到注释上。 记博客是长久的事,不能贪一时的方便。 这两周我并不是没有记博客,大致看完了图解系统 看了图解网络的t 阅读全文
posted @ 2022-03-09 17:57 liv_vil 阅读(39) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 11 下一页