测试大数据(快速排序)100万条数据

该博客介绍了如何生成100万条长整型数据并进行快速排序。通过创建文件存储数据,使用FileInputStream和FileOutputStream读写文件,然后运用快速排序算法对数据进行排序,最后输出排序所需的时间。
摘要由CSDN通过智能技术生成
该类生成了100万条数据。!!
每条数据数据都是转型完成的10位的长整型
并且该类还用到了了快速排序
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestWrite {

	public static void main(String[] args) throws IOException,
			ClassNotFoundException {
		// TODO 自动生成的方法存根
		File shorts = new File("e:\\short.txt");
		File shorts1 = new File("d:\\short.txt");
		if (!shorts.exists()) {
			shorts.createNewFile();
		}
		FileOutputStream _out = new FileOutputStream(shorts1);
		long[] a = new long[1000000];
		// String _temp = "";
		// for (int i = 0; i < a.length; i++) {
		// for (int j = 0; j < 10; j++) {
		// a[i] = getRandom();
		// _temp += a[i];
		// _out.write(a[i]);
		// }
		// if (i < 
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值