Commit 5d2fd2d4 authored by lordbenedikt's avatar lordbenedikt
Browse files

added gif to animator program

parent 6c19eede
......@@ -30,7 +30,7 @@ class Graph {
int size = todo.size();
for (int i = 0; i<size; i++) {
Node cur = todo.get(0);
if(visited.contains(cur)) {
if (visited.contains(cur)) {
continue;
}
cur.col = color(255, 0, 0);
......@@ -63,7 +63,11 @@ class Graph {
}
if (count==0) {
count = 100/speed;
bfsRek();
if (algorithm.equals("BFS")) {
bfsRek();
} else if (algorithm.equals("BFS")) {
//dfsRek();
}
}
stroke(0);
strokeWeight(1);
......@@ -93,7 +97,7 @@ class Graph {
}
if (nodeA!=null & nodeB!=null) {
nodeA.connectedTo.add(nodeB);
if(bidirectional) {
if (bidirectional) {
nodeB.connectedTo.add(nodeA);
}
}
......
A (200.0,300.0) -> B I
B (300.0,300.0) -> A C D E H
C (400.0,300.0) -> B
D (300.0,200.0) -> B
E (300.0,400.0) -> B F J
F (450.0,450.0) -> E G
G (612.0,332.0) -> F H
H (430.0,140.0) -> G B
I (130.0,200.0) -> K L
J (130.0,430.0) -> E
K (80.0,320.0) -> J
L (80.0,40.0) ->
M (600.0,150.0) -> G
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment