Skip to content

Commit 3cd1ce4

Browse files
committed
Remove print function
1 parent 1e97375 commit 3cd1ce4

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/main/java/com/thealgorithms/datastructures/stacks/NodeStack.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,4 @@ public boolean isEmpty() {
5555
public int size() {
5656
return size;
5757
}
58-
59-
public void print() {
60-
NodeStack<Item> current = head;
61-
while (current != null) {
62-
System.out.println(current.data + " ");
63-
current = current.previous;
64-
}
65-
System.out.println();
66-
}
6758
}

src/test/java/com/thealgorithms/datastructures/stacks/NodeStackTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,4 @@ void testPopOnEmptyStack() {
6363
void testPeekOnEmptyStack() {
6464
assertThrows(IllegalStateException.class, () -> { stack.peek(); });
6565
}
66-
67-
@Test
68-
void testPrintEmptyStack() {
69-
stack.print();
70-
assertEquals("", outputStreamCaptor.toString().trim(), "The output of an empty stack should be an empty string.");
71-
}
7266
}

0 commit comments

Comments
 (0)