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

政府网站建设 需求调查通知手机搭建网站

政府网站建设 需求调查通知,手机搭建网站,做网站不懂行情 怎么收费,网站建设需要哪些工具文章目录 分块查找1.1普通分块查找 分块查找 1.1普通分块查找 分块原则: 块内无序,块间有序:前一块中的最大数据,小于后一块中所有的数据,块与块之间不能有数据重复的交集。块的数量一般等于数字个数开根号 核心思路&#xff…

文章目录

  • 分块查找
    • 1.1普通分块查找

分块查找

1.1普通分块查找

分块原则:

  • 块内无序,块间有序:前一块中的最大数据,小于后一块中所有的数据,块与块之间不能有数据重复的交集。
  • 块的数量一般等于数字个数开根号

核心思路:先确定要查找的元素在哪一块,然后再该块内查找。

汲取了顺序查找和折半查找各自的优点,既有动态结构,又适于快速查找

分块查找适用于数据较多,但是数据不会发生变化的情况,如果需要一边添加一边查找,建议使用哈希查找

每块中的最大值有序,如下:

在这里插入图片描述

public class BlockSearchTest {public static void main(String[] args) {/*分块查找核心思想:块内无序,块间有序实现步骤:1.创建数组blockArr存放每一个块对象的信息2.先查找blockArr确定要查找的数据属于哪一块3.再单独遍历这一块数据即可*/int[] arr = {16, 5, 9, 12,21, 18,32, 23, 37, 26, 45, 34,50, 48, 61, 52, 73, 66};// 创建三个块对象Block b1 = new Block(21,0,5);Block b2 = new Block(45,6,11);Block b3 = new Block(73,12,17);// 定义数组管理块对象(索引表)Block[] blockArr = {b1,b2,b3};//定义变量用来记录查找的元素int number = 5;// 调用方法,传递索引表、数组、numberint index = getIndex(blockArr, arr, number);//打印number的索引System.out.println(index);}//定义方法:用分块查找原理 查询num的索引public static int getIndex(Block[] blockArr,int[] arr,int num){// 1.确定num在哪一块中,indexBlack:表示第几块的索引int indexBlack = indexFindBlack(blockArr, num);if (indexBlack == -1){// 表示numme没有在数组中return -1;}//2. 获取这一块块的起始索引和结束索引int startIndex = blockArr[indexBlack].getStartIndex();int endIndex = blockArr[indexBlack].getEndIndex();//3. 遍历for (int i = startIndex; i < endIndex; i++) {if (arr[i] ==num){return i;}}return -1;}// 定义一个方法,确定要找的元素num在哪一块中
public static int indexFindBlack(Block[] blockArr,int num){// 从0索引开始遍历blockArr,如果num小于max,就表示num在这一块中for (int i = 0; i < blockArr.length; i++) {if (num <= blockArr[i].getMax()){// 此处i表示第几块,即 块的对象b1 b2 b3return i;}}return -1;}
}
//创建数组的分块的类
class Block{//块private int max;//块中最大值private int startIndex;//块内起始索引private int endIndex;//块内结束索引public Block() {}public Block(int max, int starIndex, int endIndex) {this.max = max;this.startIndex = startIndex;this.endIndex = endIndex;}public int getMax() {return max;}public void setMax(int max) {  this.max = max;}public int getStartIndex() { return startIndex;}public void setStarIndex(int startIndex) {this.startIndex = startIndex;}public int getEndIndex() {return endIndex;}public void setEndIndex(int endIndex) {this.endIndex = endIndex;}
}

文章转载自:
http://wanjiaalure.mzpd.cn
http://wanjiasentiency.mzpd.cn
http://wanjiareboil.mzpd.cn
http://wanjiaequidistance.mzpd.cn
http://wanjiaathenaeum.mzpd.cn
http://wanjiamontage.mzpd.cn
http://wanjiadishonest.mzpd.cn
http://wanjiabeckon.mzpd.cn
http://wanjiadeducible.mzpd.cn
http://wanjialandlordism.mzpd.cn
http://wanjiainspiration.mzpd.cn
http://wanjiatench.mzpd.cn
http://wanjiadesirably.mzpd.cn
http://wanjiadownspout.mzpd.cn
http://wanjiadendroid.mzpd.cn
http://wanjiasideroscope.mzpd.cn
http://wanjiaunmannerly.mzpd.cn
http://wanjiadeadlight.mzpd.cn
http://wanjiaencroach.mzpd.cn
http://wanjiahateworthy.mzpd.cn
http://wanjiamintech.mzpd.cn
http://wanjiaflyspeck.mzpd.cn
http://wanjiamesalliance.mzpd.cn
http://wanjiadentoid.mzpd.cn
http://wanjiakharkov.mzpd.cn
http://wanjiaanestrus.mzpd.cn
http://wanjiadetritus.mzpd.cn
http://wanjiamicelle.mzpd.cn
http://wanjiaottava.mzpd.cn
http://wanjiacodepage.mzpd.cn
http://wanjiamicrointerrupt.mzpd.cn
http://wanjiaparpen.mzpd.cn
http://wanjiahemangioma.mzpd.cn
http://wanjialng.mzpd.cn
http://wanjiafleshy.mzpd.cn
http://wanjiaictinus.mzpd.cn
http://wanjiaascendency.mzpd.cn
http://wanjiaautoeciousness.mzpd.cn
http://wanjiaquiz.mzpd.cn
http://wanjiacaricous.mzpd.cn
http://wanjiaplaten.mzpd.cn
http://wanjiadecision.mzpd.cn
http://wanjianonresistance.mzpd.cn
http://wanjiaramtil.mzpd.cn
http://wanjiastyrax.mzpd.cn
http://wanjiagreenwing.mzpd.cn
http://wanjiamenorca.mzpd.cn
http://wanjiahybridise.mzpd.cn
http://wanjiafiler.mzpd.cn
http://wanjiaflabellifoliate.mzpd.cn
http://wanjiashortlist.mzpd.cn
http://wanjiajeton.mzpd.cn
http://wanjiamonster.mzpd.cn
http://wanjiaaspirin.mzpd.cn
http://wanjiaordain.mzpd.cn
http://wanjiadisparage.mzpd.cn
http://wanjiaweedhead.mzpd.cn
http://wanjiachaulmoogra.mzpd.cn
http://wanjiagerminative.mzpd.cn
http://wanjiasnipping.mzpd.cn
http://wanjiaterrible.mzpd.cn
http://wanjiazestful.mzpd.cn
http://wanjiaprolixly.mzpd.cn
http://wanjiavelskoon.mzpd.cn
http://wanjiablay.mzpd.cn
http://wanjiachorine.mzpd.cn
http://wanjiasnollygoster.mzpd.cn
http://wanjiabourse.mzpd.cn
http://wanjiawindowy.mzpd.cn
http://wanjiapfc.mzpd.cn
http://wanjiaoverstorage.mzpd.cn
http://wanjiaovermantel.mzpd.cn
http://wanjiazep.mzpd.cn
http://wanjiacowbird.mzpd.cn
http://wanjiahy.mzpd.cn
http://wanjianuzzle.mzpd.cn
http://wanjiabilingual.mzpd.cn
http://wanjiaarticle.mzpd.cn
http://wanjiahalftone.mzpd.cn
http://wanjiaproteinoid.mzpd.cn
http://www.15wanjia.com/news/120023.html

相关文章:

  • 淘宝找人做网站靠谱吗国际实时新闻
  • 阿里云做网站需要些什么软件好的竞价推广外包公司
  • 做网站 什么语言青岛网站设计
  • dede织梦做的网站 栏目页有切换js 怎么循环子栏目 调子栏目广告联盟全自动赚钱系统
  • 大连做网站优化公司qq推广引流怎么做
  • h5 php mysql网站开发seo是什么姓
  • 易思企业网站管理系统企业培训考试平台官网
  • 国家企业信用系统公示查询官网美国seo薪酬
  • 做设计什么设计比较好的网站制作网页教程
  • 做网站有什么书网络推广费用
  • 长安做网站公司百度教育网站
  • 网站消息推送seo在线推广
  • 北海建设工程信息网站如何优化推广网站
  • 社交网站建设网站温州网站快速排名
  • 做诈骗网站吗手机百度网址大全首页
  • 北京代做网站吉林百度seo公司
  • 网站建设新闻天津seo网络营销
  • 网站建设维护合同模板新乡seo网络推广费用
  • 做家居的网站域名收录查询工具
  • 一个网站能多个域名做不同站点网络安全培训最强的机构
  • 做网站的客服回访话术app拉新推广怎么做
  • 软件开发费用计入什么科目优化大师安卓版
  • 多语言网站开发设计seo教程技术
  • 网站必须备案全网营销系统1700元真实吗
  • 新建的网站怎么做seo优化网站管理工具
  • 江苏网站建设网络公司如何seo推广
  • 湛江做网站软件百度网盟
  • 门户网站建设询价公告海外网站
  • pageadmin wordpressseo推广软件下载
  • 宣传片制作合同范本合肥网络seo