Advertisement
Davencode

Untitled

Jan 9th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. ALGO(G,s,B,C)
  2. L=VUOTO
  3. INIT(G)
  4. for each b in B do
  5. if(c1[b]=bianco)then
  6. dfs_visit(G,b,c1)
  7.  
  8. for each c in C do
  9. c2[c]=nero
  10.  
  11. if(c1[s]=nero)then
  12. dfs_visit(G,s,c2)
  13. if(c2[v]=nero)then
  14. L = L u {v}
  15.  
  16. return L
  17.  
  18. --- VS soluzione nostra
  19.  
  20. INIT(G,C) <- dove C viene colorato tutto di nero
  21. L=VUOTO
  22. GT=TRASPOSTO(G)
  23. DFS_VISIT(GT,s,c1)
  24. DFS_VISIT(G,s,c2)
  25. for each b in B do
  26. if(c1[b]=nero && c2[b]=nero)then
  27. L = L u {b}
  28. return L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement