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.
Map
Stack
1 parent c17cf12 commit 8dc9d45Copy full SHA for 8dc9d45
assets/doc/03_JavaScript数据结构与算法(三)栈.md
@@ -59,7 +59,7 @@
59
60
```js
61
// 栈结构的封装
62
-class Map {
+class Stack {
63
constructor() {
64
this.items = [];
65
}
@@ -133,8 +133,8 @@ console.log(stack.toString()); //--> 1 2
133
134
135
function dec2bin(dec) {
136
- // new 一个 Map,保存余数
137
- const stack = new Map();
+ // new 一个 Stack,保存余数
+ const stack = new Stack();
138
139
// 当不确定循环次数时,使用 while 循环
140
while (dec > 0) {
0 commit comments