2020年6月5日
摘要:
安装之前需要先配置go环境 下载地址:https://golang.org/dl/ 选择go1.14.4.windows-amd64.msi 之后直接默认安装一直点next就行,安装过程中会自动添加系统变量 GOROOT: C:\Go ,Path:C:\Go\bin, 和用户变量GOPATH,无需手
阅读全文
posted @ 2020-06-05 11:36
景行cmy
阅读(239)
推荐(0)
2020年5月30日
摘要:
网上有很多mysql的安装教程,先搞清楚自己的系统版本号会少走许多弯路 uname -a //查看自己的系统版本号 我是ubuntu 64位系统,如果是centos 7系统的指路菜鸟教程的mysql安装 ubuntu系统安装比较简单,就几条命令就可以了 sudo apt-get install my
阅读全文
posted @ 2020-05-30 10:31
景行cmy
阅读(377)
推荐(0)
2020年4月13日
摘要:
string: string substr(int pos , int n) ; int find(string s , int pos) ; int find(char c , int pos) ; int find_first_of(strng s , int pos) ;int find_fi
阅读全文
posted @ 2020-04-13 11:35
景行cmy
阅读(112)
推荐(0)
2020年4月12日
摘要:
对于固定数量的数据,堆排序和快速排序都可以,数据流就用堆排序 //堆排序: class Solution { int findKthLargest(int k , vector<int>& nums) { priority_queue<int,vector<int>,greater<int>> p
阅读全文
posted @ 2020-04-12 13:59
景行cmy
阅读(106)
推荐(0)
2020年4月10日
摘要:
题目:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 题目解析:做题一定不要陷入惯性思维,要注重审题,从题目出发。不
阅读全文
posted @ 2020-04-10 10:13
景行cmy
阅读(85)
推荐(0)
2020年4月7日
摘要:
There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists of merging exactly K consecutive piles into one pil
阅读全文
posted @ 2020-04-07 13:26
景行cmy
阅读(114)
推荐(0)
2020年4月5日
摘要:
题目解析:找到最大连通块。并查集模板题。 class Solution { public: int maxAreaOfIsland(vector<vector<int>>& grid) { if(grid.empty()) return 0 ; int m = grid.size() , n = g
阅读全文
posted @ 2020-04-05 11:45
景行cmy
阅读(136)
推荐(0)
摘要:
稳定性排序:稳定性排序是指相等的元素相对位置不会发生改变。 以下介绍一系列排序算法:以非降序排列为序; 选择排序:遍历i,求[i,n)中的最小值,与A[i]交换; 时间复杂度O(N^2) void selection_sort(vector<int>& num) { int len = num.si
阅读全文
posted @ 2020-04-05 10:31
景行cmy
阅读(190)
推荐(0)
2020年4月4日
摘要:
leeetcode 33. Search in Rotated Sorted Array leetcode 81 leetcode 153. Find Minimum in Rotated Sorted Array 这几道的相似处是:都是部分有序的数组,可以用二分搜索来做。最重要的是判断到底是左区间
阅读全文
posted @ 2020-04-04 08:01
景行cmy
阅读(127)
推荐(0)
2020年4月3日
摘要:
https://leetcode.com/problems/search-in-rotated-sorted-array/ 解法一:本来有序的数组经过rotate后,分成了两部分。以最大值为分割点。通过二分搜索找最大值。然后在[0 , maxi] , 和[maxi + 1 , nums.size()
阅读全文
posted @ 2020-04-03 23:02
景行cmy
阅读(123)
推荐(0)