Docs: Update Gemini benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 22:04:41 +00:00
parent 31a18dd4ee
commit 33b8150958
220 changed files with 3259 additions and 1494 deletions

View File

@@ -1,24 +1,25 @@
const findShortestPath = async (graph, start, end) => {
const { default: PQ } = await import('https://cdn.skypack.dev/js-priority-queue');
const queue = new PQ({ comparator: (a, b) => a.d - b.d });
const dists = { [start]: 0 }, visited = new Set();
queue.queue({ n: start, d: 0 });
const { default: PriorityQueue } = await import('https://cdn.jsdelivr.net/npm/js-priority-queue@0.1.5/+esm')
const dists = new Map([[start, 0]])
const pq = new PriorityQueue({ comparator: (a, b) => a.w - b.w })
while (queue.length) {
const { n, d } = queue.dequeue();
if (n === end) return d;
if (visited.has(n)) continue;
visited.add(n);
pq.queue({ n: start, w: 0 })
while (pq.length) {
const { n, w } = pq.dequeue()
if (n === end) return w
if (w > (dists.get(n) ?? 1 / 0)) continue
for (const [neighbor, weight] of Object.entries(graph[n] || {})) {
const newDist = d + weight;
if (newDist < (dists[neighbor] ?? Infinity)) {
dists[neighbor] = newDist;
queue.queue({ n: neighbor, d: newDist });
const newWeight = w + weight
if (newWeight < (dists.get(neighbor) ?? 1 / 0)) {
dists.set(neighbor, newWeight)
pq.queue({ n: neighbor, w: newWeight })
}
}
}
return Infinity;
};
return 1 / 0
}
export default findShortestPath;