Lab 8

Warning

To compile you should use a CMakeLists.txt. It takes sometimes to get use to it, but it makes the compilation much easier.

Graph - LinkedList Representation

  • In this part you will try to implement a Linked List representation of a graph.

  • You need to have the following operations:

    • bool isEdge(int v, int w) const that returns if the edge is in the graph.

    • bool addVertex(int v) that add a vertex to the graph.

    • bool addEdge(int v, int w) that add an edge to a graph.

  • Try to create the graph seen in class.

Graph - Matrix Representation

  • In this part you will try to implement a matrix representation of a graph.

  • You need to have the following operations:

    • bool isEdge(int v, int w) const that returns if the edge is in the graph.

    • bool addVertex(int v) that add a vertex to the graph.

    • bool addEdge(int v, int w) that add an edge to a graph.

  • Try to create the graph seen in class.