We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cda368 commit 72c1467Copy full SHA for 72c1467
src/main/java/com/thealgorithms/stacks/StackUsingLinkedList.java
@@ -104,22 +104,4 @@ public void printStack() {
104
}
105
System.out.println();
106
107
-
108
- /**
109
- * Example usage
110
- */
111
- public static void main(String[] args) {
112
- StackUsingLinkedList<Integer> stack = new StackUsingLinkedList<>();
113
114
- stack.push(10);
115
- stack.push(20);
116
- stack.push(30);
117
118
- stack.printStack(); // Output: 30 20 10
119
120
- System.out.println("Top element: " + stack.peek()); // 30
121
- System.out.println("Popped: " + stack.pop()); // 30
122
- stack.printStack(); // 20 10
123
- System.out.println("Size: " + stack.size()); // 2
124
- }
125
0 commit comments