Skip to content

This project implements the bubble-sort algorithm in ruby using yield and block

Notifications You must be signed in to change notification settings

joshuaivie/mv-rb_Bubble-Sort

Repository files navigation

Bubble Sort Algorithm

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.

screenshot

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

Built With

  • Ruby

Live Demo

You can check out the live demo here

Getting Started

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

Prerequisites

  1. Code Editor
  2. Terminal (Bash)
  3. Git
  4. Ruby

Setup

  • 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

Usage

  • Ensure you're in the directory in which you've set up the project
  • Run the following command
ruby bubble_sort.rb

Author

👤 Joshua Ivie

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is MIT licensed.

About

This project implements the bubble-sort algorithm in ruby using yield and block

Topics

Resources

Stars

Watchers

Forks

Languages