Bubble sort is an inefficient sorting algorithm that sorts at O(n*n) time complexity. This project is simply a practice for the Ruby Programming Language.
- Ruby
- The code needs to have a sorting method that sorts arrays using the Bubble Sort algorithm
- Clone the project in to your computer using
git clone https://github.com/DejazmachMolla/bubble-sort.git
cd
into thebubble-sort
folder- Open buuble_sort.rb and add the following 4 lines at the end to test the program
- print bubble_sort([6, 5, 7, 3, 9, 0])
- puts
- print bubble_sort_by(["Abebe", "Kebede", "Amy", "Abe"]) { |a, b| a.length <=> b.length }
- puts
- run the command
ruby bubble_sort.rb
👤 Dejazmach Molla
- Github: @DejazmachMolla
- Twitter: @DJATSS
- Linkedin: Dejazmach Molla
Give a ⭐️ if you like this project!
- Microverse