Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. V E
  2. v0:{v1,v2}
  3. v1:{v3}
  4. v2:{v3}
  5. v3:{}
  6.  
  7. V E
  8. v0: {v1,v2} mark, enqueue v0
  9. v1: {v3}
  10. v2: {v3}
  11. v3: {}
  12.  
  13. V E
  14. v0: {v1,v2} dequeue v0;mark, enqueue v1,v2
  15. v1: {v3}
  16. v2: {v3}
  17. v3: {}
  18.  
  19. V E
  20. v0: {v1,v2}
  21. v1: {v3} dequeue v1; mark,enqueue v3
  22. v2: {v3}
  23. v3: {}
  24.  
  25. V E
  26. v0: {v1,v2}
  27. v1: {v3}
  28. v2: {v3} dequeue v2, check its adjacency list (v3 already marked)
  29. v3: {}
  30.  
  31. V E
  32. v0: {v1,v2}
  33. v1: {v3}
  34. v2: {v3}
  35. v3: {} dequeue v3; check its adjacency list
  36.  
  37. V E
  38. v0: {v1,v2} |E0|=2
  39. v1: {v3} |E1|=1
  40. v2: {v3} |E2|=1
  41. v3: {} |E3|=0
  42.  
  43. |V| + |E0| + |E1| + |E2| +|E3| == |V|+|E|
  44. 4 + 2 + 1 + 1 + 0 == 4 + 4
  45. 8 == 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement