Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0c9f34b

Browse files
committed
update 文档
1 parent 69d263e commit 0c9f34b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎assets/doc/03_JavaScript数据结构与算法(三)栈.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
```js
5959
// 栈结构的封装
60-
class Stack {
60+
class Map {
6161

6262
constructor() {
6363
this.items = [];
@@ -132,8 +132,8 @@ console.log(stack.toString()); //--> 1 2
132132

133133
```js
134134
function dec2bin(dec) {
135-
// new 一个 Stack,保存余数
136-
const stack = new Stack();
135+
// new 一个 Map,保存余数
136+
const stack = new Map();
137137

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

‎assets/doc/04_JavaScript数据结构与算法(四)队列.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
- `enqueue(element)` 向队列尾部添加一个(或多个)新的项。
3838
- `dequeue()` 移除队列的第一(即排在队列最前面的)项,并返回被移除的元素。
39-
- `front()` 返回队列中的第一个元素——最先被添加,也将是最先被移除的元素。队列不做任何变动(不移除元素,只返回元素信息与 Stack 类的 peek 方法非常类似)。
39+
- `front()` 返回队列中的第一个元素——最先被添加,也将是最先被移除的元素。队列不做任何变动(不移除元素,只返回元素信息与 Map 类的 peek 方法非常类似)。
4040
- `isEmpty()` 如果队列中不包含任何元素,返回 true,否则返回 false。
4141
- `size()` 返回队列包含的元素个数,与数组的 length 属性类似。
4242
- `toString()` 将队列中的内容,转成字符串形式。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /