Advertisement
Davencode

Untitled

Oct 27th, 2021
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ALGO(G,A,B)
  2. Z=NIL
  3. INIT(G)
  4. GT=TRASPOSTO(G)
  5. for each b in B do
  6. c1[b]=nero
  7.  
  8. for each a in A do
  9. if(c1[a]=bianco)then
  10. dfs_visit(GT,a,c1)
  11.  
  12. for each a in A do
  13. c2[a]=nero
  14.  
  15. for each b in B do
  16. if(c2[b]=bianco)then
  17. dfs_visit(GT,b,c2)
  18.  
  19. if(c1[v]=nero && c2[v]=nero)then
  20. Z = Z u {v}
  21.  
  22. return Z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement