Skip to content

Commit 4acfdb1

Browse files
committed
clang-format applied to pass clang-format job
1 parent 259fbfa commit 4acfdb1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/main/java/com/thealgorithms/stacks/StackUsingLinkedList.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public T pop() throws NoSuchElementException {
6363
throw new NoSuchElementException();
6464
}
6565

66-
T removed = top.element; //Get the last inserted element before removing it
66+
T removed = top.element; // Get the last inserted element before removing it
6767

68-
top = top.next; //Set the second to last element at the top
68+
top = top.next; // Set the second to last element at the top
6969

7070
size--;
7171

@@ -84,11 +84,11 @@ public void push(T element) {
8484
Node next;
8585

8686
if (top != null) {
87-
next = top; //Save the current top node
87+
next = top; // Save the current top node
8888

89-
top = node; //Update the newest node
89+
top = node; // Update the newest node
9090

91-
top.next = next; //Make the new node point to the old node
91+
top.next = next; // Make the new node point to the old node
9292
} else {
9393

9494
top = node;

src/test/java/com/thealgorithms/stacks/StackUsingLinkedListTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package com.thealgorithms.stacks;
22

3+
import java.util.NoSuchElementException;
34
import org.junit.jupiter.api.Assertions;
45
import org.junit.jupiter.api.BeforeEach;
56
import org.junit.jupiter.api.Test;
67

7-
import java.util.NoSuchElementException;
8-
98
class StackUsingLinkedListTest {
109

1110
private StackUsingLinkedList<Integer> linkedStack;
@@ -36,7 +35,7 @@ void pop() {
3635

3736
linkedStack.pop();
3837

39-
Assertions.assertThrows(NoSuchElementException.class, () -> linkedStack.pop()); //Cannot pop from an empty stack
38+
Assertions.assertThrows(NoSuchElementException.class, () -> linkedStack.pop()); // Cannot pop from an empty stack
4039
}
4140

4241
@Test
@@ -49,7 +48,6 @@ void push() {
4948
linkedStack.push(17);
5049

5150
Assertions.assertEquals(17, linkedStack.peek());
52-
5351
}
5452

5553
@Test

0 commit comments

Comments
 (0)