Algorithms and some visualizations using Elm
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project contains some algorithms written in Elm and also visualization of some of these algorithms. It includes:
- Sorts
- Bubble Sort*
- Merge Sort*
- Quick Sort*
- Selection Sort*
- Kth lowest element
- Transpose Matrix
- Graphs
- DFS*
- Kruskal maze generator*
* algorithms containing visualization
The website was developed also in Elm. The source code is also here, at the same repository.
There are some features in the Sort Algorithms visualization like:
- ⚙️ Select how many elements are going to be sorted
- 📊 Step-by-step iteration
- 🔢 Count of how many steps (approximation)
- 🖍️ Color usage to indicate interesting pivots, comparations
- ⏯️ Pause/Continue
- 🎲 Shuffle to generate other random set to be ordered
- 💻 Code included
- 🔉 Sounds
In order to generate the steps, a not so easy to understand code was done to save all the iterations that happened in the set (including comparations and swaps). All the steps are saved in a big list to enable the step-by-step feature. This consume a lot of memory of the browser.
At the DFS, you can select the start and end points. The starting point will be the blue and the end point will be the green one. There are some colors in the path. The blue one is a possible candidate to be the final path, the red lines are paths that will not be included in the final path since they have already been tested and backtracked. The green one are the final path.
At the maze generation, there are current no features. Some features that it could include are: change the size of the maze, generate using other algorithms.
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/allannozomu/Elm-Algorithms