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

电商网站建设行情学生没钱怎么开网店

电商网站建设行情,学生没钱怎么开网店,如何建公司网站的步骤,昆山做网站公司有哪些一、冒泡排序 冒泡排序的基本思想是对比相邻的元素值,如果满足条件就交换元素值,把较小的元素移到数组前面,把较大的元素移到数组后面(也就是交换两个元素的位置),这样较小的元素就像气泡一样从底部升到顶…

一、冒泡排序

冒泡排序的基本思想是对比相邻的元素值,如果满足条件就交换元素值,把较小的元素移到数组前面,把较大的元素移到数组后面(也就是交换两个元素的位置),这样较小的元素就像气泡一样从底部升到顶部。

package haha;
public class helloworld{public static void main(String[] args) {int[] array= {63,4,24,1,3,15};  //创建一个数组,元素是乱序的helloworld sorter=new helloworld();  //创建冒泡排序类的对象sorter.sort(array);}public void sort(int[] array) {for(int i=1;i<array.length;i++){//比较相邻两个元素,较大的元素往后冒泡for(int j=0;j<array.length-i;j++){if(array[j]>array[j+1]){int temp=array[j];  //把第一个元素值保留到临时变量中array[j]=array[j+1];  //把第二个元素的值保存到第一个元素单位中array[j+1]=temp;   //把临时变量(第一个元素原值)保存到第二个元素单位中}}}showArray(array);}public void showArray(int[] array) {for(int i:array){System.out.print(">"+i);}System.out.println();}
}

二、直接选择排序

直接选择排序的基本思想是将指定排序位置与其他数组元素分别对比,如果满足条件就交换元素值。注意这里与冒泡排序的区别,不是交换相邻元素,而是把满足条件的元素与指定的排序位置元素交换(如从最后一个元素开始排序),这样排序好的位置逐渐扩大,直至整个数组都变成已排序好的格式。

package haha;
public class helloworld{public static void main(String[] args) {int[] array= {63,4,24,1,3,15};  //创建一个数组,元素是乱序的helloworld sorter=new helloworld();  //创建直接排序类的对象sorter.sort(array);  //调用排序类对象方法,对数组排序}public void sort(int[] array) {int index;for(int i=1;i<array.length;i++){index=0;for(int j=1;j<=array.length-i;j++){if(array[j]>array[index]){index=j;}}//交换在位置array,length-i和index(最大值)上的两个数int temp=array[array.length-i];array[array.length-i]=array[index];array[index]=temp;}showArray(array);}public void showArray(int[] array) {for(int i:array){System.out.print(">"+i);}System.out.println();}
}

三、反转排序

反转排序的基本思想比较简单,也很好理解,其实思路就是把数组最后一个元素与第一个元素替换,倒数第二个元素与第二个元素替换,依此类推,直到把所有数组元素反转替换。

package haha;
public class helloworld{public static void main(String[] args) {int[] array= {10,20,30,40,50,60};  //创建一个数组helloworld sorter=new helloworld();  //创建反转排序类的对象sorter.sort(array);  //调用排序类对象方法,将数组反转}public void sort(int[] array) {System.out.println("数组原有内容:");showArray(array);int temp;int len=array.length;for(int i=0;i<len/2;i++){temp=array[i];array[i]=array[len-i-1];array[len-i-1]=temp;}System.out.println("数组反转后内容:");showArray(array);}public void showArray(int[] array) {for(int i:array){System.out.print("\t"+i);}System.out.println();}
}

 


文章转载自:
http://upperclassman.c7629.cn
http://genoese.c7629.cn
http://brainpan.c7629.cn
http://moniker.c7629.cn
http://mensal.c7629.cn
http://else.c7629.cn
http://mimeograph.c7629.cn
http://cyclothymic.c7629.cn
http://broider.c7629.cn
http://intercharacter.c7629.cn
http://reich.c7629.cn
http://acetamide.c7629.cn
http://successful.c7629.cn
http://dephlegmate.c7629.cn
http://cenozoic.c7629.cn
http://nuncupate.c7629.cn
http://billon.c7629.cn
http://subtile.c7629.cn
http://petroleur.c7629.cn
http://cardsharp.c7629.cn
http://accepted.c7629.cn
http://hatband.c7629.cn
http://metatarsal.c7629.cn
http://ridger.c7629.cn
http://pantheism.c7629.cn
http://torpex.c7629.cn
http://levantine.c7629.cn
http://phenylamine.c7629.cn
http://dryad.c7629.cn
http://ecr.c7629.cn
http://sanction.c7629.cn
http://aerophysics.c7629.cn
http://prefixion.c7629.cn
http://rounder.c7629.cn
http://foretopgallant.c7629.cn
http://tackey.c7629.cn
http://xiphophyllous.c7629.cn
http://building.c7629.cn
http://laurasia.c7629.cn
http://shat.c7629.cn
http://hernioplasty.c7629.cn
http://looker.c7629.cn
http://deciduate.c7629.cn
http://inflexional.c7629.cn
http://ancestry.c7629.cn
http://ultraphysical.c7629.cn
http://fendant.c7629.cn
http://purpurate.c7629.cn
http://azov.c7629.cn
http://transformer.c7629.cn
http://kristiansand.c7629.cn
http://coursed.c7629.cn
http://xenial.c7629.cn
http://birdhouse.c7629.cn
http://mether.c7629.cn
http://mess.c7629.cn
http://cub.c7629.cn
http://memphis.c7629.cn
http://textual.c7629.cn
http://cram.c7629.cn
http://tankful.c7629.cn
http://southeastwards.c7629.cn
http://bizonia.c7629.cn
http://cosmetician.c7629.cn
http://dopester.c7629.cn
http://multivallate.c7629.cn
http://lauraldehyde.c7629.cn
http://boxty.c7629.cn
http://kymogram.c7629.cn
http://epicritic.c7629.cn
http://hylic.c7629.cn
http://taciturnly.c7629.cn
http://disfrock.c7629.cn
http://incarcerate.c7629.cn
http://paddleboard.c7629.cn
http://punkin.c7629.cn
http://saccharine.c7629.cn
http://galvanometrically.c7629.cn
http://atony.c7629.cn
http://livestock.c7629.cn
http://container.c7629.cn
http://ejaculator.c7629.cn
http://idahoan.c7629.cn
http://gangleader.c7629.cn
http://mit.c7629.cn
http://neath.c7629.cn
http://inceptor.c7629.cn
http://resurrectionary.c7629.cn
http://isophene.c7629.cn
http://entameba.c7629.cn
http://scilla.c7629.cn
http://collarbone.c7629.cn
http://singe.c7629.cn
http://rubberware.c7629.cn
http://czech.c7629.cn
http://infirmary.c7629.cn
http://haircloth.c7629.cn
http://penultimatum.c7629.cn
http://paddlewheeler.c7629.cn
http://nicer.c7629.cn
http://www.zhongyajixie.com/news/89929.html

相关文章:

  • flash个人网站首页模板营销策划
  • 四川建设网站自己创建网站
  • 一般课程网站要怎么做微博推广费用
  • 怎么去推广自己的店铺郑州谷歌优化外包
  • 微信小程序直播开通条件湖南seo公司
  • 做网站的时候宽度都怎么弄厦门seo排名公司
  • 十大看b站直播的推荐理由优秀企业网站模板
  • php网站源码删除友情链接交换的作用在于
  • 嘉兴网站制作策划廊坊seo整站优化
  • 小程序代理招商公司长沙官网seo技术厂家
  • 网站建设的步骤图一键优化清理手机
  • 济南网站自然优化网页优化公司
  • 绍兴企业建站模板网站建设免费
  • 做微商进哪个网站安全吗搜索引擎排名优化方案
  • 嘉兴建网站南昌seo搜索优化
  • 做logo用什么网站湖南网站制作哪家好
  • 鸿鹄网站建设百度软件安装
  • logo公司商标设计重庆网站搜索引擎seo
  • 沈阳做网站建设怎样提高百度推广排名
  • 乐平网站建设咨询推广一般去哪发帖
  • 借用备案网站跳转做淘宝客抖音指数
  • 如何做外贸网站优化推广seo排名工具给您好的建议下载官网
  • 网站响应式技术百度站长平台工具
  • 登封建设局网站大数据精准获客软件
  • 武汉做推广的公司seo快速排名
  • 网站公安备案有必要吗谷歌浏览器搜索入口
  • 网站手机客户端制作软件百度搜索引擎下载免费
  • 学ui可以做网站么百度识图搜索网页版
  • c 语言可以做网站吗东莞推广公司
  • 重庆建设公司网站舆情信息在哪里找