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 cf8c663 commit a27759dCopy full SHA for a27759d
yoonexample/src/main/java/stack/ListStack.java
@@ -0,0 +1,42 @@
1
+package stack;
2
+
3
+public class ListStack<E> implements Stack<E> {
4
5
+ private int size;
6
+ private Node<E> head;
7
8
+ @Override
9
+ public int size() {
10
+ return this.size;
11
+ }
12
13
14
+ public boolean isEmpty() {
15
+ return this.size == 0;
16
17
18
19
+ public void push(E data) {
20
21
22
23
24
+ public E pop() {
25
+ return null;
26
27
28
29
+ public E peek() {
30
31
32
33
+ private static class Node<T> {
34
35
+ private T data;
36
+ private Node<T> next;
37
38
+ public Node(T data) {
39
+ this.data = data;
40
41
42
+}
0 commit comments