funksiyani dijkstra(graph, startNode) { // Ko'rmagan tugunlar to'plamini yarating. const unvisited = yangi Set(graph.nodes); // Boshlash tugunidan har bir tugunga bo'lgan masofa xaritasini yarating. const distances = yangi Xaritasi); uchun (const node of graph.nodes) { distances.set(node, Infinity); } // Boshlash tugunidan o'ziga bo'lgan masofa nolga o'rnating. distances.set(startNode, 0); // Boshlash tugunidan bo'lgan masofaga qarab saralab berilgan tugunlarning ustuvorlik navbatini yarating. Priority constue = yangi PriorityQueue; priorityQueue; Queue.add(startNode, 0); // Priority navbat bo'sh bo'lmagan vaqtda: while! (pri
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence