Mercurial > hg > Members > tatsuki > Alice
changeset 163:db1bae5db5d2 working
minor change
author | sugi |
---|---|
date | Wed, 12 Dec 2012 21:17:35 +0900 |
parents | 7f8a3680a35c |
children | 9c28131e814f |
files | src/alice/test/codesegment/local/bitonicsort/ShowData.java src/alice/test/codesegment/local/bitonicsort/Sort.java |
diffstat | 2 files changed, 21 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/bitonicsort/ShowData.java Wed Dec 12 21:09:21 2012 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/ShowData.java Wed Dec 12 21:17:35 2012 +0900 @@ -24,7 +24,7 @@ } @Override public void run() { - System.out.println(System.currentTimeMillis() -SetTask.t); + System.out.println(System.currentTimeMillis() -SetTask.t +" ms"); DataList list0 = info0.asClass(DataList.class); DataList list1 = info1.asClass(DataList.class); DataList list2 = info2.asClass(DataList.class);
--- a/src/alice/test/codesegment/local/bitonicsort/Sort.java Wed Dec 12 21:09:21 2012 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/Sort.java Wed Dec 12 21:17:35 2012 +0900 @@ -5,22 +5,9 @@ import java.util.List; public class Sort { - public static void check(List<Integer> numbers){ - int number1 = 0; - int number2 = 0; - Iterator<Integer> iter = numbers.iterator(); - - System.out.println("checking ...."); - while (iter.hasNext()){ - number1 = number2; - number2 = iter.next(); - if (number1 > number2){ - System.out.println("MISS "+ number1+" > "+number2); - return; - } - } - System.out.println("sort is succeed"); - } + /* + * quick method has problem. + */ public static List<Integer> quickSort(List<Integer> numbers){ if (numbers.size() < 400){ @@ -104,4 +91,21 @@ list.set(index1,list.get(index2)); list.set(index2, tmp); } + + public static void check(List<Integer> numbers){ + int number1 = 0; + int number2 = 0; + Iterator<Integer> iter = numbers.iterator(); + + System.out.println("checking ...."); + while (iter.hasNext()){ + number1 = number2; + number2 = iter.next(); + if (number1 > number2){ + System.out.println("MISS "+ number1+" > "+number2); + return; + } + } + System.out.println("sort is succeed"); + } }