
简介
该用户还未填写简介
擅长的技术栈
未填写擅长的技术栈
可提供的服务
暂无可提供的服务
二分查找递归和非递归(c++实现)
1、应用条件1.1、储存在数组中1.2、有序(如果是无序的要先排序)2、实现方法2.1递归实现int BinarySearch(int array[], int low, int high, int value){if(low>high)return -1;int mid=low+(high-low)/2;if(array[mid]==value)return mid;else if(arr
开发环境搭建
1、安装虚拟机2、安装Linux系统(虚拟机安装或云服务器)https://releases.ubuntu.com/bionic/3、安装XSHELL、XFTP(远程连接软件)4、安装Visual Studio Codehttps://code.visualstudio.com5、安装ssh服务器sudo apt install openssh-server6、Xshell连接查看ip:ifcon
c++中count函数
头文件algorithmcount函数功能类似于find函数。count用于统计容器中某个value的个数。示例:#include<iostream>#include<algorithm>using namespace std;int a[7] = { 1, 2, 3, 4, 4, 4, 4 };vector<int> nums(a, a+7);int main
到底了







