Week 11
Objectives : to learn more about graphs. Reference Carrano Chapter 13.- * Trace through Dijkstra's single-source shortest path algorithm on the above graph, starting from vertex a. Show the vertex set and weight array at each step. Wherever there is a choice of vertex you should choose the smallest alphabetically.
- * Trace through Prim's MST algorithm on the above graph, starting from vertex a. REMEMBER to ignore directions for Prim's Algorithm. Wherever there is a choice of vertex you should choose the smallest alphabetically.
- * Write a c++ function which when passed an adjacency matrix representing an unweighted undirected graph will display the vertices in a depth-first search.
void depthFirst(int matrix[n][n], int n) // matrix [0..n-1][0..n-1] is an adjacency matrix for a graph of n vertices // postcondition : displays the vertices in depth first order.
- Carrano Chap 13 exercise 4
- Carrano Chap 13 exercise 5
- Carrano Chap 13 exercise 10
- Carrano Chap 13 exercise 11
- Carrano Chap 13 Exercise 14