Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jadi gini :
- while(!q.empty()) {
- int now = q.front(); q.pop();
- di_dalam_queue[now] = false;
- for(all adjacent){
- if (dist[adjacent] > dist[now] + cost) {
- butuh update kayak dijkstra biasa
- dist[adjacent] = dist[now] + cost;
- if (di_dalam_queue[adjacent]) continue;
- di_dalam_queue[adjacent] = true;
- q.push(adjacent);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement