Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. jadi gini :
  2.  
  3. while(!q.empty()) {
  4. int now = q.front(); q.pop();
  5. di_dalam_queue[now] = false;
  6. for(all adjacent){
  7. if (dist[adjacent] > dist[now] + cost) {
  8. butuh update kayak dijkstra biasa
  9. dist[adjacent] = dist[now] + cost;
  10.  
  11. if (di_dalam_queue[adjacent]) continue;
  12. di_dalam_queue[adjacent] = true;
  13. q.push(adjacent);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement