[prev] 29 [next]

Exercise 5: Vertex Degrees

  1. Write the degree(g,v) function (assume adj.matrix representation)
  2. Write a function that ...
    • takes a graph and an array of nV ints
    • sets the vth array entry to the degree of vertex v

    Use the function interface:

    void degrees(Graph g, int ds[]) { ... }
    

  3. Use degrees to re-implement hasEulerPath()