title: adjacency matrix in java or c++ to find connected nodes
body: <p>I am given a problem where I have been given N nodes in a graph that are interconnected to each other then given a matrix which lists down a node being connected to another (1 if it is, 0 if not).  I am wondering how to best approach this problem.  I think these are adjacency matrix? But how would I implement that ...</p>
  
  <p>Basically what I am trying to get out of these is find whether a particular node is connected to all other nodes in a given set 'S'.  And whether selected items are clique or not...</p>
  
  <p>I'd appreciate any hints.</p>