| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | # ArraySortAlgorithm | |
| 2 | 2 | 各个排序算法 | |
| 3 | 3 | ||
| 4 | + ---------------------------------------------- | ||
| 4 | 5 | 本人CSDN博客 [点击链接](http://blog.csdn.net/lemon_tree12138) | |
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff 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 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,8 @@ private void core(int[] array) { | |||
| 39 | 39 | ||
| 40 | 40 | // 希尔排序的直接插入排序 | |
| 41 | 41 | 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); | ||
| 43 | 44 | for (int i = 1; i < groupCount; i++) { | |
| 44 | 45 | int nextIndex = offset + step * i; | |
| 45 | 46 | int waitInsert = array[nextIndex]; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments