This project is entry project for ruby, which has been built to sort arrays with the bubble sort methodology. And it consists of two types of methods, first - sorts the array with ruby method, second - sorts the array with the method which has yield and block.
In an unsorted array of elements, start with the first two elements and sort them in ascending order. (Compare the element to check which one is greater).
- Compare the second and third element to check which one is greater, and sort them in ascending order.
- Compare the third and fourth element to check which one is greater, and sort them in ascending order.
- Compare the fourth and fifth element to check which one is greater, and sort them in ascending order.
- Repeat steps 1–5 until no more swaps are required.
There's also an entry on Bubble Sort on Wikipedia that's worth taking a look at.
To get a local copy up and running follow these simple steps.
git clone https://github.com/AbdumurodovaZulfizar/bubble-sort.git
cd bubble-sort
- Open this repository on your device
👩🏻💼 Zulfizar Abdumurodova
- GitHub: Zulfizar Abdumurodova
- Twitter: Zulfizar Abdumurodova
- LinkedIn: Zulfizar Abdumurodova
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
- Microverse for international opportunities and their
README
template.
Copyright 2021 Zulfizar Abdumurodova
- MIT license for this project.