Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar11 / bfs-dfs.cpp
diff options
context:
space:
mode:
Commit63f4cb943f81c257e78ebeef828edbc04e78264b (patch)
Author
 Stoycho Kyosev <stoycho.kk@gmail.com>
2023-01-04 15:07:15 +0200
Committer
 Stoycho Kyosev <stoycho.kk@gmail.com>
2023-01-04 15:07:15 +0200
Files2a9972460ab6719f392f56f84f1edc2f568b85b8 /Seminar11/bfs-dfs.cpp
Data-structures-and-algorithms-63f4cb943f81c257e78ebeef828edbc04e78264b.tar
Data-structures-and-algorithms-63f4cb943f81c257e78ebeef828edbc04e78264b.tar.gz
Data-structures-and-algorithms-63f4cb943f81c257e78ebeef828edbc04e78264b.zip
Parentfcb06959d4425310eadee643f3fab68604063f51 (diff)
Add seminar 12
1 files changed, 4 insertions, 3 deletions
-rw-r--r--Seminar11/bfs-dfs.cpp7
diff --git a/Seminar11/bfs-dfs.cpp b/Seminar11/bfs-dfs.cpp
index 19ef1b9..75a6f3d 100644
--- a/Seminar11/bfs-dfs.cpp
+++ b/Seminar11/bfs-dfs.cpp
@@ -49,9 +49,10 @@ void DFS(const AdjListGraph& g, AdjListGraph::vertex_t start) {
DFSRec(visited, g, start);
}
+
int main() {
- MatrixGraph g(5);
- // AdjListGraph g(5);
+ // MatrixGraph g(5);
+ AdjListGraph g(5);
g.addEdge(0, 2, 1);
g.addEdge(0, 3, 1);
g.addEdge(0, 1, 1);
@@ -60,5 +61,5 @@ int main() {
g.addEdge(3, 4, 1);
g.addEdge(1, 3, 1);
- BFS(g, 0);
+ DFS(g, 0);
} \ No newline at end of file