Skip to content

AllanNozomu/Elm-Algorithms

Repository files navigation

MIT License Built with Elm


Elm Algorithms

Algorithms and some visualizations using Elm
View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. License

About The Project

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.

Sort

Merge Sort

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.

Graph

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.

dfs

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.

Kruskal Maze Generator

Built With

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/allannozomu/Elm-Algorithms

About

Some algorithms written in elm to study the language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published