java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-32
来源:互联网 发布:传奇盛世宝石升级数据 编辑:程序博客网 时间:2024/05/16 03:06
package chapter7;import java.util.Arrays;public class T32 {public static void main(String[] args) {int[] list={10 ,1, 26,11,3,8,3,5 ,16 ,61 ,9 ,11, 1};int[] list2=partition(list);System.out.println(Arrays.toString(list2));}public static int[] partition(int[] list) {int first=0;//记录插入多少小于首元素的元素,游标int end=list.length-1;//记录插入多少大于首元素的元素,游标int[] newList=new int[list.length];for(int i=1;i<list.length;i++){if(list[i]<list[0])newList[first++]=list[i];elsenewList[end--]=list[i];}newList[first]=list[0];return newList;}}
0 0
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-32
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-21
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-23
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-24
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-30
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-31
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-33
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-32
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-27
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-28
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-29
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-30
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-31
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter12-11
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-10
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-6
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-13
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-14
- 在Editplus配置PHP
- Bzoj3791:作业:DP
- ext2文件系统源代码之xattr_security.c
- Http协议访问DataSnap Rest 服务器 - 封三郎
- sizeof
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-32
- Spark 性能相关参数配置详解-Storage篇
- RTSP实例解析
- 遗传算法学习心得
- 第一遍 第三章线性表
- 开始启程,你的第一行
- (15.1.15) 工具型产品如何建立自己的商业化模式?
- 4.1 面向对象程序设计概述
- 修复K2_user的重定向URL不起作用