uchennaanya / Ruby-bubble-sort

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

License:MIT License


Languages

Language:Ruby 100.0%