English subtitles

← Connected Components - Intro to Algorithms

Get Embed Code
3 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Well, unlike the previous example,
  2. this is a little bit harder to see.
  3. Certainly it's not the case that there's
  4. nice white space in between separating them.
  5. It seems to be a little tangled up,
  6. but we can figure out the number of components,
  7. and one way to do it is we can just start systematically
  8. seeing what's connected to what.
  9. So starting from this node here,
  10. we can see this node can reach this one,
  11. and this one,
  12. well, and itself,
  13. and did we miss any?
  14. Yeah, this node, which is part of that set--
  15. call that the purple group, group A--
  16. can also reach this node.
  17. But notice that's as far as it goes.
  18. All the purple nodes are connected to other purple nodes
  19. but not to the nonpurple nodes, and in fact,
  20. you can see that the nonpurple nodes can all speak to each other.
  21. So in fact, there's two separate,
  22. disconnected components in this example.