Social Network 1.0.0
The second major course output (MCO2) for CCDSALG.
|
The utility functions that are used to traverse through graphs and get the list of the visited vertices in order. More...
Go to the source code of this file.
Functions | |
void | breadth_first_search (const Graph *const graph, const Vertex starting_vertex, Vertex visited_vertices[MAX_GRAPH_VERTEX_COUNT], size_t *const visited_vertex_count) |
Traverses through all of a graph’s connected vertices starting from a specific vertex. | |
void | depth_first_search (const Graph *const graph, const Vertex starting_vertex, Vertex visited_vertices[MAX_GRAPH_VERTEX_COUNT], size_t *const visited_vertex_cnt) |
Traverses through all of a graph’s connected vertices starting from a specific vertex. |
The utility functions that are used to traverse through graphs and get the list of the visited vertices in order.
void breadth_first_search | ( | const Graph *const | graph, |
const Vertex | starting_vertex, | ||
Vertex | visited_vertices[MAX_GRAPH_VERTEX_COUNT], | ||
size_t *const | visited_vertex_count ) |
Traverses through all of a graph’s connected vertices starting from a specific vertex.
This uses the breadth-first search algorithm to traverse through the graph.
[in] | graph | The graph to traverse through. |
starting_vertex | The vertex to start from. | |
[out] | visited_vertices | The vertices visited during the traversal. |
[out] | visited_vertex_count | The number of vertices visited during the traversal. |
void depth_first_search | ( | const Graph *const | graph, |
const Vertex | starting_vertex, | ||
Vertex | visited_vertices[MAX_GRAPH_VERTEX_COUNT], | ||
size_t *const | visited_vertex_cnt ) |
Traverses through all of a graph’s connected vertices starting from a specific vertex.
This uses the depth-first search algorithm to traverse through the graph.
[in] | graph | The graph to traverse through. |
starting_vertex | The vertex to start from. | |
[out] | visited_vertices | The vertices visited during the traversal. |
[out] | visited_vertex_cnt | The number of vertices visited during the traversal. |