Skip to content

Commit

Permalink
我猜原本的是书写错误, 用Map很有误导, 所以改成Stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
koneMorris1625 authored Oct 14, 2021
1 parent c17cf12 commit 8dc9d45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/doc/03_JavaScript数据结构与算法(三)栈.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

```js
// 栈结构的封装
class Map {
class Stack {
constructor() {
this.items = [];
}
Expand Down Expand Up @@ -133,8 +133,8 @@ console.log(stack.toString()); //--> 1 2

```js
function dec2bin(dec) {
// new 一个 Map,保存余数
const stack = new Map();
// new 一个 Stack,保存余数
const stack = new Stack();

// 当不确定循环次数时,使用 while 循环
while (dec > 0) {
Expand Down

0 comments on commit 8dc9d45

Please sign in to comment.