Skip to content
Snippets Groups Projects
Commit 4c398c3c authored by Jakob Olsson's avatar Jakob Olsson
Browse files

add print_list

parent 84f57fc5
Branches
No related tags found
No related merge requests found
......@@ -60,4 +60,16 @@ void clear_list(struct list_head *visited)
list_del(&n->list);
free(n);
}
}
void print_list_dfs(struct list_head *collection_of_nodes_and_stuff)
{
struct node *n;
if (list_empty(collection_of_nodes_and_stuff))
return;
list_for_each_entry(n, collection_of_nodes_and_stuff, list) {
printf("path: %s\n", n->path);
}
}
\ No newline at end of file
......@@ -13,4 +13,5 @@ struct node *stack_dequeue(struct list_head *stack);
void add_visited(struct node *n, struct list_head *visited);
bool is_visited(char *path, struct list_head *visited);
void clear_list(struct list_head *visited);
void print_list_dfs(struct list_head *collection_of_nodes_and_stuff);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment