mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-05 03:30:30 +08:00
update: Use function declarations instead of function expressions. (#385)
Co-authored-by: steak-zhuo <zhuoqinyue@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ const { Vertex } = require('../include/Vertex');
|
||||
|
||||
/* 广度优先遍历 BFS */
|
||||
// 使用邻接表来表示图,以便获取指定顶点的所有邻接顶点
|
||||
const graphBfs = (graph, startVet) => {
|
||||
function graphBfs(graph, startVet) {
|
||||
// 顶点遍历序列
|
||||
const res = [];
|
||||
// 哈希表,用于记录已被访问过的顶点
|
||||
|
||||
Reference in New Issue
Block a user