Skip to content

Commit fd8dc0a

Browse files
committed
Fix minor formatting issues and typos
1 parent c0676c1 commit fd8dc0a

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

src/algorithms/sorting/bubbleSort/BubbleSort.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
* Space:
3232
* - O(1) since sorting is done in-place
3333
*/
34-
3534
public class BubbleSort {
3635
/**
3736
* Sorts the given array in-place in non-decreasing order.
@@ -40,7 +39,7 @@ public class BubbleSort {
4039
*/
4140
public static int[] sort(int[] arr) {
4241
int n = arr.length;
43-
boolean swapped; //tracks of the presence of swaps within one iteration of the outer loop to
42+
boolean swapped; // tracks of the presence of swaps within one iteration of the outer loop to
4443
// facilitate early termination
4544
for (int i = 0; i < n - 1; i++ ) { //outer loop which supports the invariant
4645
swapped = false;

src/dataStructures/linkedList/LinkedList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public String toString() {
307307
ret += trav + " ";
308308
trav = trav.next;
309309
}
310-
return ret.substring(0, ret.length());
310+
return ret;
311311
}
312312

313313
/**

test/algorithms/graphs/breadthFirstSearchTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public void bfs_levelOrderTraversal_shouldReturnAccurate() {
4444
List<Integer> thirdResult = breadthFirstSearch.levelOrder(root3);
4545

4646
assert firstResult.equals(firstList);
47-
System.out.println(secondResult.toString());
47+
// System.out.println(secondResult.toString());
4848
assert secondResult.equals(secondList);
49-
System.out.println(thirdResult.toString());
49+
// System.out.println(thirdResult.toString());
5050
assert thirdResult.equals(thirdList);
5151
}
5252

test/dataStructures/linkedList/LinkedListTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.junit.Assert;
44
import org.junit.Test;
55
import src.dataStructures.linkedList.LinkedList;
6-
import src.dataStructures.linkedList.LinkedList.Node;
76

87
public class LinkedListTest {
98
@Test
@@ -42,12 +41,6 @@ public void testSearchAndGet() {
4241
Integer test2 = ll.search(3);
4342
Assert.assertEquals("3", test2.toString());
4443

45-
Node<Integer> test3 = ll.get(3);
46-
Assert.assertEquals("3", test3.toString());
47-
48-
Node<Integer> test4 = ll.get(10);
49-
Assert.assertEquals(null, test4);
50-
5144
Assert.assertEquals("0 1 2 3 4 5 6 7 ", ll.toString());
5245
}
5346

0 commit comments

Comments
 (0)