/Ruby-bubble-sort

This is the Microverse first ruby project that illustrates bubble sort.

Primary LanguageRubyMIT LicenseMIT

Bubble sort and bubble sort by algorithm

Definition

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

Explanation on how bubble sort works can be well illustrated by below gif image:

Bubble sort explanation

About the Project

In this project, there are two methods bubble_sort and bubble_sort_by.

  • bubble_sort method sorts the array of integers in ascending order.
  • bubble_sort_by method sorts the array of strings in ascending order based on the number of characters in the string.

Built With

  • Ruby

Live Demo

Live Demo Link

Getting Started

Just clone this repo and and navigate to the folder.

To get a local copy up and running follow these simple example steps.

  • Clone this repo.
  • Navigate to the bubble_sort folder
  • In your terminal run ruby main.rb
  • You are successful to get a local copy up and running.

Authors

👤 David Bassey

👤 Uchenna Anya

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Bubble sort explanation gif image downloaded from Wikipedia
  • the odin project

📝 License

This project is MIT licensed.