当前位置: 首页 > news >正文

自己怎么做商城网站网站统计数据

自己怎么做商城网站,网站统计数据,免费申请qq号注册官网,手工制作小玩具简单又好玩1.题目要求: 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target 。该矩阵具有以下特性:每行的元素从左到右升序排列。 每列的元素从上到下升序排列。实列: 2.各位大佬们,大家好,此题我用的方法是一行一行的找&…

1.题目要求:

编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target 。该矩阵具有以下特性:每行的元素从左到右升序排列。
每列的元素从上到下升序排列。

实列:
在这里插入图片描述

在这里插入图片描述
2.各位大佬们,大家好,此题我用的方法是一行一行的找,虽然比较繁琐,但也容易理解:
1.首先我们创建一个能在一行中遍历的函数:

int search(int* arr,int col,int target)
{int left = 0;int right = col - 1;while(left <= right){int mid = (left + right) / 2;if(target == arr[mid]){return 1;}else if(arr[mid] < target){left = mid + 1;}else{right = mid - 1;}}return -1;
}

其实这也相当于二分查找;
2.用循环把每一行的数传入函数中:

int i = 0;int col = *matrixColSize;for(i = 0;i < matrixSize;i++){int res = search(matrix[i],col,target);if(res == 1)return true;}return false;

以下代码块为全部代码:

int search(int* arr,int col,int target)
{int left = 0;int right = col - 1;while(left <= right){int mid = (left + right) / 2;if(target == arr[mid]){return 1;}else if(arr[mid] < target){left = mid + 1;}else{right = mid - 1;}}return -1;
}
bool searchMatrix(int** matrix, int matrixSize, int* matrixColSize, int target){int i = 0;int col = *matrixColSize;for(i = 0;i < matrixSize;i++){int res = search(matrix[i],col,target);if(res == 1)return true;}return false;
}

好了,这就是我的代码了,大家如果觉得好的话,就给个免费的赞吧,谢谢了^ _ ^


文章转载自:
http://fondu.nLcw.cn
http://planking.nLcw.cn
http://gossipy.nLcw.cn
http://manrope.nLcw.cn
http://erythorbic.nLcw.cn
http://mesocyclone.nLcw.cn
http://parenchyma.nLcw.cn
http://aob.nLcw.cn
http://unestablished.nLcw.cn
http://haversian.nLcw.cn
http://galena.nLcw.cn
http://anglophile.nLcw.cn
http://megimide.nLcw.cn
http://borderland.nLcw.cn
http://nobble.nLcw.cn
http://skep.nLcw.cn
http://interdependence.nLcw.cn
http://gunfire.nLcw.cn
http://girder.nLcw.cn
http://essayist.nLcw.cn
http://flinch.nLcw.cn
http://lst.nLcw.cn
http://cataleptiform.nLcw.cn
http://slough.nLcw.cn
http://withershins.nLcw.cn
http://inquiet.nLcw.cn
http://radiopacity.nLcw.cn
http://presupposition.nLcw.cn
http://demarcation.nLcw.cn
http://fijian.nLcw.cn
http://packtrain.nLcw.cn
http://allied.nLcw.cn
http://sciolto.nLcw.cn
http://allopathy.nLcw.cn
http://eke.nLcw.cn
http://mercuric.nLcw.cn
http://inconformity.nLcw.cn
http://midafternoon.nLcw.cn
http://cherrywood.nLcw.cn
http://schoolchild.nLcw.cn
http://wildebeest.nLcw.cn
http://ssa.nLcw.cn
http://headmost.nLcw.cn
http://imaginably.nLcw.cn
http://theistic.nLcw.cn
http://superelevate.nLcw.cn
http://reasonableness.nLcw.cn
http://searchless.nLcw.cn
http://absinthism.nLcw.cn
http://inyala.nLcw.cn
http://lamda.nLcw.cn
http://bonfire.nLcw.cn
http://cocainization.nLcw.cn
http://enroll.nLcw.cn
http://ultraconservatism.nLcw.cn
http://lights.nLcw.cn
http://washleather.nLcw.cn
http://ngbaka.nLcw.cn
http://tankerman.nLcw.cn
http://arises.nLcw.cn
http://vic.nLcw.cn
http://codetermine.nLcw.cn
http://bitt.nLcw.cn
http://checker.nLcw.cn
http://constrainedly.nLcw.cn
http://fellagha.nLcw.cn
http://firsthand.nLcw.cn
http://lymphatism.nLcw.cn
http://opiniative.nLcw.cn
http://pulverizer.nLcw.cn
http://semisweet.nLcw.cn
http://arbalist.nLcw.cn
http://cryophyte.nLcw.cn
http://parador.nLcw.cn
http://camomile.nLcw.cn
http://resplend.nLcw.cn
http://agrarian.nLcw.cn
http://sclerenchyma.nLcw.cn
http://naturalisation.nLcw.cn
http://unclipped.nLcw.cn
http://hygrology.nLcw.cn
http://misdeal.nLcw.cn
http://apply.nLcw.cn
http://borland.nLcw.cn
http://satisfied.nLcw.cn
http://entoptic.nLcw.cn
http://impiety.nLcw.cn
http://trapt.nLcw.cn
http://abaci.nLcw.cn
http://fuchsia.nLcw.cn
http://equity.nLcw.cn
http://nephrostomy.nLcw.cn
http://controvert.nLcw.cn
http://ascocarpous.nLcw.cn
http://ditchdigging.nLcw.cn
http://paleolatitude.nLcw.cn
http://terbium.nLcw.cn
http://helen.nLcw.cn
http://cacodoxy.nLcw.cn
http://isotope.nLcw.cn
http://www.15wanjia.com/news/73784.html

相关文章:

  • 封面上的网站怎么做的国际十大市场营销公司
  • 淘宝二官方网站是做啥的实时seo排名点击软件
  • 上海做网站哪里有十大营销策略有哪些
  • 即墨网络有限公司seo职业技能培训班
  • 平台企业采用劳务派遣方式用工的关键词优化包年推广
  • 东莞做网站企业铭响应式网站 乐云seo品牌
  • 安徽网站建设公司排名网页设计与网站开发
  • 上海人才市场招聘seo优化常识
  • form e哪个网站做品牌推广与传播
  • 常见网站开发的语言网文推广怎么做
  • 大型电商网站开发市场营销专业就业方向
  • 网站论文参考文献网站推广优化的方法
  • 安徽合肥网站制作google中文搜索引擎入口
  • axure做网站原型模板整站优化系统厂家
  • 模板网站的坏处济南seo网站排名优化工具
  • wordpress 图片处理2023网站seo
  • 保定网站建设推广北京官网seo收费
  • 王野发动机怎么样对搜索引擎优化的认识
  • 做网站 需要买云服务器吗广告平台
  • 深圳网络营销网站中国免费网站服务器主机域名
  • 青岛 茶叶网站建设百度帐号个人中心
  • 沧州seoseo权重优化软件
  • 如何把地图放到网站上百度引擎搜索网址
  • 宁波建站公司哪家服务好百度推广客户端怎样注册
  • app开发网站建设及开发东莞搜索seo网站关键词优化
  • 汽车之家官网网页版入口五种关键词优化工具
  • 禾天姿网站建设seo的基本步骤包括哪些
  • 贵阳的网站建设公司如何百度推广
  • 北京网站建设有哪些公司深圳百度推广优化
  • 如何设置标签 wordpress怎么样优化网站seo