Week 10 Solutions

  1. 6 vertices 7 edges
  2. Yes connected
  3. Yes cycle AEBA and EBCDE and other related ones
  4. 3 (3 edges incident on B)
  5. 4 (E)
  6.        A  B  C  D  E  F
         A 0 10  ~  ~  7  ~ 
         B 10 0  6  ~  12 ~
         C ~  6  0  4  0  ~
         D ~  ~  4  0  4  ~
         E 7  12 0  4  0  5
         F ~  ~  ~  ~   5 0 
    
    where A == 0, B == 1 etc as indexes into matrix.
    And diagonal can be 0 or 1 or ~ depending on application.  
    
  7. A -> B 10 -> E 7 B -> A 10 -> C 6 -> E 12 C -> B 6 -> D 4 D E F etc
  8. depth first search A E D C B F
  9. breadth first search A B E C D F
  10. If given vertex v
    Traverse row V and count the non-zero columns
  11. If given vertex v
    Traverse linked list at array[v] counting the nodes in the list