Skip to content

Commit b0c71e7

Browse files
committed
优化图结构
1 parent 6db243e commit b0c71e7

3 files changed

Lines changed: 42 additions & 7 deletions

File tree

动态规划算法/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@
6363
// console.log(generator.next(25))
6464

6565

66+
// console.log('开始')
67+
68+
// function foo() {
69+
// console.log('pp')
70+
// return () => {
71+
// console.log('执行完成')
72+
// }
73+
// }
74+
75+
// setTimeout(foo(), 0)
76+
77+
78+
// setTimeout(foo, 0)
79+
80+
// new Promise((res, rej) => {
81+
// console.log('皮肉')
82+
// res(99)
83+
// }).then(res => {
84+
// console.log(res)
85+
// })
6686

6787

6888
</script>

图数据结构(Graph)/Graph.drawio

Lines changed: 20 additions & 5 deletions
Large diffs are not rendered by default.

图数据结构(Graph)/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Graph.prototype.BFS = function (v, callback) {
7070
// 先将 一个顶点 进入队列
7171
queue.enqueue(v); //{4}
7272
while (!queue.isEmpty()) { //{5}
73-
// 在拿出队列
73+
// 从队列取出一个元素
7474
let u = queue.dequeue(); //{6}
7575
// 根据A可以拿到 A 对应的保存的队列 比如 A -> B,C,D
76-
let neighbors = this.adjList.get(u); //{7}
76+
let neighbors = this.adjList.get(u); //{7} 拿到数组元素
7777
color[u] = 'grey'; // {8}
7878

7979
// 会先将这里的for执行完在去进行while循环

0 commit comments

Comments
 (0)