The bubble sort algorithm is a fairly straight forward sorting algorithm that repeatedly iterates over list comparing adjacent elements in the list and swapping the elements if they are in the wrong order.
Although fairly simple to understand and implement the O(n^2) time complexity of bubble sort means it's performance drastically deteriorates as the size of the list increases.
This project implements the bubble-sort algorithm in ruby using yield and block
- Ruby
You can check out the live demo here
To get a local copy up and running, follow these simple example steps.
- Install the prerequisites on your local machine
- Clone the repository to your local machine as described in the setup section
- run the bubble_sort.rb file using ruby in your terminal as described in the usage section
- Code Editor
- Terminal (Bash)
- Git
- Ruby
- Open your terminal and navigate to location in which you would like to setup the project.
- Run the following command in your terminal
git clone https://github.com/joshuaivie/mv_rb-bubble-sort
- Ensure you're in the directory in which you've set up the project
- Run the following command
ruby bubble_sort.rb
👤 Joshua Ivie
- GitHub: @joshuaivie
- Twitter: @joshuaivie_
- LinkedIn: joshuaivie
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.