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

modify · Lamperougeyxy/ArraySortAlgorithm@56a947d · GitHub

Repository navigation

Commit 56a947d

Browse files
committed
modify
1 parent f2f23fe commit 56a947d

9 files changed

Lines changed: 164 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# ArraySortAlgorithm
22
各个排序算法
33

4+
----------------------------------------------
45
本人CSDN博客 [点击链接](http://blog.csdn.net/lemon_tree12138)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 梳排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class CombSort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 循环排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class CycleSort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 地精排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class GnomeSort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 堆排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class HeapSort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 猴子排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class MonkeySort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 奇偶排序算法
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class ParitySort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.algorithm.array.sort.impl;
2+
3+
import org.algorithm.array.sort.interf.Sortable;
4+
5+
/**
6+
* <p>
7+
* 基于冒泡的快速排序
8+
* </p>
9+
* 2016年1月21日
10+
*
11+
* @author <a href="http://weibo.com/u/5131020927">Q-WHai</a>
12+
* @see <a href="http://blog.csdn.net/lemon_tree12138">http://blog.csdn.net/lemon_tree12138</a>
13+
* @version 0.1.1
14+
*/
15+
public class QuickWithBubbleSort implements Sortable {
16+
17+
@Override
18+
public int[] sort(int[] array) {
19+
// TODO Auto-generated method stub
20+
return null;
21+
}
22+
23+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ private void core(int[] array) {
3939

4040
// 希尔排序的直接插入排序
4141
private void insert(int[] array, int offset, int step) {
42-
int groupCount = array.length / step + (array.length % step > offset ? 1 : 0);
42+
int arrayLength = array.length;
43+
int groupCount = arrayLength / step + (arrayLength % step > offset ? 1 : 0);
4344
for (int i = 1; i < groupCount; i++) {
4445
int nextIndex = offset + step * i;
4546
int waitInsert = array[nextIndex];

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL