Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar11 / Graph-Impl / AdjacencyListGraph / src.cpp
diff options
context:
space:
mode:
Commit750de18faa33ae862a3348a6679f32e1517a3d4b (patch)
Author
 Stoycho Kyosev <stoycho.kk@gmail.com>
2022-12-21 18:44:34 +0200
Committer
 Stoycho Kyosev <stoycho.kk@gmail.com>
2022-12-21 18:44:34 +0200
Files281c8c52621b86185f755936e8b1c46287ca3ae0 /Seminar11/Graph-Impl/AdjacencyListGraph/src.cpp
Data-structures-and-algorithms-750de18faa33ae862a3348a6679f32e1517a3d4b.tar
Data-structures-and-algorithms-750de18faa33ae862a3348a6679f32e1517a3d4b.tar.gz
Data-structures-and-algorithms-750de18faa33ae862a3348a6679f32e1517a3d4b.zip
Parentc1b3267208163f17c08d545f805f0b412d35d377 (diff)
add Seminar11
1 files changed, 19 insertions, 0 deletions
-rw-r--r--Seminar11/Graph-Impl/AdjacencyListGraph/src.cpp19
diff --git a/Seminar11/Graph-Impl/AdjacencyListGraph/src.cpp b/Seminar11/Graph-Impl/AdjacencyListGraph/src.cpp
new file mode 100644
index 0000000..b0484e0
--- /dev/null
+++ b/Seminar11/Graph-Impl/AdjacencyListGraph/src.cpp
@@ -0,0 +1,19 @@
+#include<iostream>
+#include<list>
+#include<algorithm>
+#include"AdjListGraph.h"
+
+int main() {
+ AdjListGraph g(10);
+
+ g.addEdge(0, 1, 1);
+ g.addEdge(0, 2, 1);
+ g.addEdge(0, 3, 1);
+ g.addEdge(0, 4, 1);
+
+ auto res = g.adjacent(1);
+
+ for(auto i : res) {
+ std::cout << i.to << " ";
+ }
+} \ No newline at end of file