Skip to content

Commit 4a50a20

Browse files
authored
Update Stacks.md
1 parent ba4c5c7 commit 4a50a20

File tree

1 file changed

+4
-0
lines changed
  • Basic Data Structures/Implementation of Stack in JavaScript

1 file changed

+4
-0
lines changed

Basic Data Structures/Implementation of Stack in JavaScript/Stacks.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@ class Stack {
123123
return this.reverse ? this.stack.shift() : this.stack.pop();
124124
}
125125
}
126+
127+
```
128+
129+
> **As the number of items grows, push/pop becomes increasingly more performant than unshift/shift because every item needs to be reindexed in the latter but not the former.

0 commit comments

Comments
 (0)