博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【代码积累】quick sort
阅读量:4099 次
发布时间:2019-05-25

本文共 583 字,大约阅读时间需要 1 分钟。

import java.awt.image.PixelInterleavedSampleModel;public class Main {	public static void main(String[] args) {		// TODO Auto-generated method stub		//int[] test = {5,4,3,2,1};		int[] test={49,38,65,97,76,13,27,49,78,34,12,64,5,4,62,99,98,54,56,17,18,23,34,15,35,25,53,51};		quickSort(test,0,test.length-1);				for(int i=0;i
= right ) { return; } /*选出pivot的index作为参考,根据pivot对原数组进行划分,再分别对左右子数组递归调用quickSort*/ //此处选择二分法选择pivot int pivotIndex = (left+right)/2; //调用partition,根据pivotValue对数组进行重排 int regroupIndex = partition(a,left,right,pivotIndex); // for(int i=0;i

转载地址:http://cthii.baihongyu.com/

你可能感兴趣的文章
VS编译器运行后闪退,处理方法
查看>>
用div+css做下拉菜单,当鼠标移向2级菜单时,为什么1级菜单的a:hover背景色就不管用了?
查看>>
idea 有时提示找不到类或者符号
查看>>
JS遍历的多种方式
查看>>
ng-class的几种用法
查看>>
node入门demo-Ajax让前端angularjs/jquery与后台node.js交互,技术支持:mysql+html+angularjs/jquery
查看>>
神经网络--单层感知器
查看>>
注册表修改DOS的编码页为utf-8
查看>>
matplotlib.pyplot.plot()参数详解
查看>>
拉格朗日对偶问题详解
查看>>
MFC矩阵运算
查看>>
最小二乘法拟合:原理,python源码,C++源码
查看>>
ubuntu 安装mysql
查看>>
Win32编程绘图实例--字母图
查看>>
c# 计算器
查看>>
C# 简单的矩阵运算
查看>>
gcc 常用选项详解
查看>>
c++输入文件流ifstream用法详解
查看>>
c++输出文件流ofstream用法详解
查看>>
字符编码:ASCII,Unicode 和 UTF-8
查看>>