FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

update · Lspecial/ArraySortAlgorithm@c2168b1 · GitHub

Repository navigation

Commit c2168b1

Browse files
committed
update
1 parent becee6a commit c2168b1

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/org/algorithm/array/sort/client/SortClient.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package org.algorithm.array.sort.client;
22

3-
import org.algorithm.array.sort.impl.OddEvenSort;
3+
import org.algorithm.array.sort.impl.QuickSort;
44
import org.algorithm.array.sort.interf.Sortable;
55
import org.utils.naga.containers.ArrayUtils;
66

77
public class SortClient {
88

99
public static void main(String[] args) {
10-
int[] array = {34, 23, 76, 56, 54, 12, 34, 65, 45, 9, 8, 7, 6, 5};
10+
// int[] array = {34, 23, 76, 56, 54, 12, 34, 65, 45, 9, 8, 7, 6, 5};
1111
// int[] array = {34, 23, 98, 76, 56, 45};
1212
// int[] array = {23, 34, 54, 56, 76, 98};
13-
// int[] array = {6, 5, 4, 3, 2, 1};
13+
int[] array = {3, 4, 1, 7, 6, 2, 0};
1414
ArrayUtils.show(array);
15-
Sortable sortable = new OddEvenSort();
15+
Sortable sortable = new QuickSort();
1616
array = sortable.sort(array);
1717
ArrayUtils.show(array);
1818
}

‎src/org/algorithm/array/sort/impl/QuickSort.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.algorithm.array.sort.impl;
22

3+
import java.util.Arrays;
4+
35
import org.algorithm.array.sort.interf.Sortable;
46

57
/**
@@ -41,6 +43,8 @@ private void sortCore(int[] array, int startIndex, int endIndex) {
4143

4244
int boundary = boundary(array, startIndex, endIndex);
4345

46+
System.err.println(Arrays.toString(array));
47+
4448
sortCore(array, startIndex, boundary - 1);
4549
sortCore(array, boundary + 1, endIndex);
4650
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL