docs: update the whole repository

* fix some bugs
* delete duplicate files
* format code
This commit is contained in:
yanglbme
2019-05-09 19:32:54 +08:00
parent 163db8521a
commit 29948363da
368 changed files with 4372 additions and 30841 deletions

View File

@@ -1,20 +1,18 @@
package Sorts;
/**
*
* @author Mateus Bizzo (https://github.com/MattBizzo)
* @author Podshivalov Nikita (https://github.com/nikitap492)
*
*/
class CocktailShakerSort implements SortAlgorithm {
/**
* This method implements the Generic Cocktail Shaker Sort
*
* @param array The array to be sorted
* Sorts the array in increasing order
**/
/**
* This method implements the Generic Cocktail Shaker Sort
*
* @param array The array to be sorted
* Sorts the array in increasing order
**/
@Override
public <T extends Comparable<T>> T[] sort(T[] array) {
@@ -47,19 +45,19 @@ class CocktailShakerSort implements SortAlgorithm {
}
// Driver Program
public static void main(String[] args) {
// Integer Input
Integer[] integers = { 4, 23, 6, 78, 1, 54, 231, 9, 12 };
CocktailShakerSort shakerSort = new CocktailShakerSort();
// Driver Program
public static void main(String[] args) {
// Integer Input
Integer[] integers = {4, 23, 6, 78, 1, 54, 231, 9, 12};
CocktailShakerSort shakerSort = new CocktailShakerSort();
// Output => 1 4 6 9 12 23 54 78 231
SortUtils.print(shakerSort.sort(integers));
// Output => 1 4 6 9 12 23 54 78 231
SortUtils.print(shakerSort.sort(integers));
// String Input
String[] strings = { "c", "a", "e", "b", "d" };
SortUtils.print(shakerSort.sort(strings));
}
// String Input
String[] strings = {"c", "a", "e", "b", "d"};
SortUtils.print(shakerSort.sort(strings));
}
}