Skip to content

Commit ae2d761

Browse files
author
alx
committed
Remove redundant main, remove redundant tests.
1 parent c5ba307 commit ae2d761

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

src/main/java/com/thealgorithms/sorts/OddEvenSort.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.thealgorithms.sorts;
22

3-
import java.util.Random;
4-
53
/**
64
* OddEvenSort class implements the SortAlgorithm interface using the odd-even sort technique.
75
* Odd-even sort is a comparison sort related to bubble sort.
@@ -40,24 +38,4 @@ public <T extends Comparable<T>> T[] sort(T[] arr) {
4038
}
4139
return arr;
4240
}
43-
44-
public static void main(String[] args) {
45-
final Integer[] arr = new Integer[100];
46-
final Random random = new Random();
47-
48-
// Print out unsorted elements
49-
for (int i = 0; i < arr.length; ++i) {
50-
arr[i] = random.nextInt(100) - 50;
51-
System.out.println(arr[i]);
52-
}
53-
System.out.println("--------------");
54-
final OddEvenSort oddEvenSort = new OddEvenSort();
55-
oddEvenSort.sort(arr);
56-
57-
// Print Sorted elements
58-
for (int i = 0; i < arr.length - 1; ++i) {
59-
System.out.println(arr[i]);
60-
assert arr[i] <= arr[i + 1];
61-
}
62-
}
6341
}
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.thealgorithms.sorts;
22

3-
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
4-
5-
import org.junit.jupiter.api.Test;
6-
73
/**
84
* @author Tabbygray (https://github.com/Tabbygray)
95
* @see OddEvenSort
@@ -16,27 +12,4 @@ public class OddEvenSortTest extends SortingAlgorithmTest {
1612
SortAlgorithm getSortAlgorithm() {
1713
return oddEvenSort;
1814
}
19-
20-
@Test
21-
public void oddEvenSortEmptyArray() {
22-
Integer[] inputArray = {};
23-
Integer[] expectedOutput = {};
24-
assertArrayEquals(inputArray, expectedOutput);
25-
}
26-
27-
@Test
28-
public void oddEvenSortNaturalNumberArray() {
29-
Integer[] inputArray = {18, 91, 86, 60, 21, 44, 37, 78, 98, 67};
30-
oddEvenSort.sort(inputArray);
31-
Integer[] expectedOutput = {18, 21, 37, 44, 60, 67, 78, 86, 91, 98};
32-
assertArrayEquals(inputArray, expectedOutput);
33-
}
34-
35-
@Test
36-
public void oddEvenSortIntegerArray() {
37-
Integer[] inputArray = {57, 69, -45, 12, -85, 3, -76, 36, 67, -14};
38-
oddEvenSort.sort(inputArray);
39-
Integer[] expectedOutput = {-85, -76, -45, -14, 3, 12, 36, 57, 67, 69};
40-
assertArrayEquals(inputArray, expectedOutput);
41-
}
4215
}

0 commit comments

Comments
 (0)