You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you've programmed your algorithm, you just need to create a 'AlgorithmVisualizer' value in your main class like this:
17
+
```
18
+
AlgorithmVisualizer algorithmVisualizer = new AlgorithmVisualizer();
19
+
```
20
+
Now you need to call your method and pass the array as parameter, like this for example:
21
+
22
+
```
23
+
bubblesort(algorithmVisualizer.getArray());
24
+
```
25
+
26
+
## Animation
27
+
Now you actually 'connected' your algorithm with the library, but you actually should add a 'delay' after every operation in your algorithm, because otherwise your algorithm would be sorted instantly.
28
+
29
+
You can easily just add
30
+
```
31
+
Thread.sleep(30);
32
+
```
33
+
whenever your values are changing. I would recommend a value between 20-50.
34
+
35
+
## Have fun!
36
+
Now, this is it. Enjoy your little animaition and maybe some updates in the future!
0 commit comments