![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
西瓜籽辣
这个作者很懒,什么都没留下…
展开
-
搜索插入位置
CPP class Solution { public: int searchInsert(vector<int>& nums, int target) { int middle, left = 0, right = nums.size() - 1; while(left <= right){ //假定为升序排列 mi = (left + right) / 2; if(nums[mid] =转载 2021-11-17 21:16:34 · 66 阅读 · 0 评论 -
void 和 int的返回值问题
#include<bits/stdc++.h> using namespace std; int Hax(int a[],int len,int &maxv) { maxv = 0; //假设a[0]为最大值,maxv存储最大值下标; for(int i = 1; i < len; i++){ if(a[i] > a[maxv]){ //如果a[i]比假设的的最大值还大, maxv = i; /...原创 2021-11-17 00:20:35 · 939 阅读 · 0 评论