File tree Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,12 @@ export class Stack {
8
8
}
9
9
10
10
push ( value : number ) : void {
11
- // ListNode newNode = new ListNode(value);
12
11
const newNode = new ListNode ( value )
13
- // newNode.next = top;
14
12
newNode . next = this . top ;
15
- // top = newNode;
16
13
this . top = newNode ;
17
14
}
18
15
19
16
pop ( ) : number | undefined {
20
- // if (this.isEmpty()) {
21
- // throw new EmptyStackException();
22
- // } else {
23
- // int value = top.val;
24
- // top = top.next;
25
- // return value;
26
- // }
27
17
if ( this . isEmpty ( ) ) {
28
18
return undefined ;
29
19
}
@@ -34,10 +24,6 @@ export class Stack {
34
24
}
35
25
36
26
peek ( ) : number | null {
37
- // if (this.isEmpty()) {
38
- // throw new EmptyStackException();
39
- // }
40
- // return top.val;
41
27
if ( this . isEmpty ( ) ) {
42
28
return undefined ;
43
29
}
You can’t perform that action at this time.
0 commit comments