Skip to content

Commit 6178458

Browse files
committed
minor: fix spaces and indentations
1 parent 9c03738 commit 6178458

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ public static int[] sort(final int[] array) {
7373
* @param target the value to find position for
7474
* @return the correct insertion index
7575
*/
76-
private static int binarySearch(final Integer[] spaced,
77-
final int inserted, final int target) {
76+
private static int binarySearch(final Integer[] spaced, final int inserted, final int target) {
7877
int lo = 0;
7978
int hi = inserted;
8079
while (lo < hi) {

src/test/java/com/thealgorithms/sorts/LibrarySortTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ public class LibrarySortTest {
1010

1111
@Test
1212
public void testBasicSort() {
13-
assertArrayEquals(new int[]{1, 2, 3, 4, 5}, LibrarySort.sort(new int[]{5, 3, 1, 4, 2}));
13+
assertArrayEquals(new int[] {1, 2, 3, 4, 5}, LibrarySort.sort(new int[] {5, 3, 1, 4, 2}));
1414
}
1515

1616
@Test
1717
public void testAlreadySorted() {
18-
assertArrayEquals(new int[]{1, 2, 3, 4, 5}, LibrarySort.sort(new int[]{1, 2, 3, 4, 5}));
18+
assertArrayEquals(new int[] {1, 2, 3, 4, 5}, LibrarySort.sort(new int[] {1, 2, 3, 4, 5}));
1919
}
2020

2121
@Test
2222
public void testReverseSorted() {
23-
assertArrayEquals(new int[]{1, 2, 3, 4, 5}, LibrarySort.sort(new int[]{5, 4, 3, 2, 1}));
23+
assertArrayEquals(new int[] {1, 2, 3, 4, 5}, LibrarySort.sort(new int[] {5, 4, 3, 2, 1}));
2424
}
2525

2626
@Test
2727
public void testDuplicates() {
28-
assertArrayEquals(new int[]{1, 2, 2, 3, 3}, LibrarySort.sort(new int[]{3, 2, 1, 3, 2}));
28+
assertArrayEquals(new int[] {1, 2, 2, 3, 3}, LibrarySort.sort(new int[] {3, 2, 1, 3, 2}));
2929
}
3030

3131
@Test
3232
public void testSingleElement() {
33-
assertArrayEquals(new int[]{1}, LibrarySort.sort(new int[]{1}));
33+
assertArrayEquals(new int[] {1}, LibrarySort.sort(new int[] {1}));
3434
}
3535

3636
@Test
3737
public void testEmptyArray() {
38-
assertArrayEquals(new int[]{}, LibrarySort.sort(new int[]{}));
38+
assertArrayEquals(new int[] {}, LibrarySort.sort(new int[] {}));
3939
}
4040

4141
@Test

0 commit comments

Comments
 (0)