Skip to content

Commit ea50791

Browse files
committed
feat: add stacks
1 parent 5b7da76 commit ea50791

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Stack {
2+
constructor() {
3+
this.stack = new Array()
4+
}
5+
6+
push(n) {
7+
this.stack.push(n)
8+
}
9+
10+
pop() {
11+
return this.stack.pop()
12+
}
13+
14+
size() {
15+
return this.stack.length
16+
}
17+
}

0 commit comments

Comments
 (0)