I decided to learn about Binary Heap Data Structures and Kruskal's Algorithm. Understanding how these work was fun and challenging. I lean more on visual learning so I decided to visualize these two topics in the Unity game engine with the idea that it will help others in the future to understand these topics better. Nonetheless, I gained more experience with the game engine itself and C#.
Binary Heap Data Structures
The biggest challenge during development of this project, was to code the evenly automatic spreading of nodes in the binary heap tree, depending on the number of nodes. I decided to lock the node count to 31 because it go off screen, however, you can see how the tree spreads evenly when inserting or extracting elements from the binary heap tree.
The second part was learning about the Binary Heap Data Structures operations, of which I have visualized by simply using Unity Coroutines and colors for connections/branches.
The second part was learning about the Binary Heap Data Structures operations, of which I have visualized by simply using Unity Coroutines and colors for connections/branches.
Kruskal's Minimum Spanning Tree
Generating and placing tree nodes randomly was not an issue, however randomizing the connections between the nodes and having no overlapping connections was a bit tricky. The reason for having no overlapping connections and nodes was of pure esthetical reasons. The table table below shows the disjoint set operations of make set, find and union by showing the respective parent and tree ranks of nodes. The disjoint set is optimized by using the Union by rank and Path by compression.