From The Odin Project
Build a method #bubble_sort that takes an array and returns a sorted array. It must use the bubble sort methodology (using #sort would be pretty pointless, wouldn’t it?).
Use the following command to run the application
- from the root folder:
ruby bubble_sort/bubble_sort.rb
OR
- from inside the bubble_sort folder
ruby bubble_sort.rb
Before: [4, 3, 78, 2, 0, 2]
After: [0, 2, 2, 3, 4, 78]
Before: [1, 2, 3, 4, 5]
After: [1, 2, 3, 4, 5]
Before: [2, 3, 4, 5, 1]
After: [1, 2, 3, 4, 5]