![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
力扣题目
李大宝652
这个作者很懒,什么都没留下…
展开
-
冒泡排序及其优化
冒泡排序及其优化 冒泡排序优化3 public static void sort(int array[]) { int lastExchangeIndex = 0;//最后一次交换的位置 int sortBorder = array.length - 1;//无序数列的边界,每次比较到这里为止 for(int i = 0; i < array.length - 1; i++) { ...原创 2020-03-13 14:27:43 · 79 阅读 · 0 评论 -
c++笔记string
string类的字符操作 const char &operator[](int n)const; const char &at(int n)const; char &operator[](int n); char &at(int n); 截取 #include<string> #include<iostream> using na...原创 2020-03-12 20:01:39 · 172 阅读 · 0 评论 -
旋转数组查找
题目:给定一个排序数组nums(nums中有无重复元素),且nums可能以某个未知下标旋转,给定目标值target,求target是否在nums中出现,若出现返回下标,未出现返回-1 算法思路 当target < nums[mid]: if(nums[begin] < nums[mid]) (说明==递增区间== [begin,mid-1] ,==旋转区间==为[mid+1,end...原创 2020-03-09 21:31:51 · 121 阅读 · 0 评论