Docs: Update benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 23:31:52 +00:00
parent 341252fec1
commit 5855cf8a6f
77 changed files with 972 additions and 1051 deletions

View File

@@ -0,0 +1,22 @@
const findShortestPath = async (g, s, e) => {
const { default: Q } = await import('https://esm.sh/js-priority-queue')
const q = new Q({ comparator: (a, b) => a.w - b.w })
const d = { [s]: 0 }
q.queue({ n: s, w: 0 })
while (q.length) {
const { n, w } = q.dequeue()
if (n === e) return w
if (w > (d[n] ?? Infinity)) continue
for (const v in g[n]) {
const k = w + g[n][v]
if (k < (d[v] ?? Infinity)) {
d[v] = k
q.queue({ n: v, w: k })
}
}
}
return Infinity
}
export default findShortestPath;