码迷,mamicode.com
首页 > 其他好文 > 详细

第十二周(MySort)

时间:2018-05-20 23:14:31      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:linux   其他   lin   ring   code   设计   产品   需要   博客   

注意:研究sort的其他功能,要能改的动代码,需要答辩
模拟实现Linux下Sort -t : -k 2的功能。
要有伪代码,产品代码,测试代码(注意测试用例的设计)
参考 Sort的实现。提交博客链接。

  1 import java.util.*;
  2
  3 public class MySort1 {
  4     public static void main(String [] args) {
  5         String [] toSort = {"aaa:10:1:1",
  6                             "ccc:30:3:4",
  7                             "bbb:50:4:5",
  8                             "ddd:20:5:3",
  9                             "eee:40:2:20"};
 10
 11         System.out.println("Before sort:");
 12         for (String str: toSort)
 13                     System.out.println(str);
 14
 15         Arrays.sort(toSort);
 16
 17         System.out.println("After sort:");
 18         for( String str : toSort)
 19             System.out.println(str);
 20     }
 21 }

第十二周(MySort)

标签:linux   其他   lin   ring   code   设计   产品   需要   博客   

原文地址:https://www.cnblogs.com/yjtblog/p/9065054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!