Skip to content

root-code-software/Advanced-Building-Blocks---Bubble-Sort

Repository files navigation

Forks Stargazers Issues-open Issues-closed Contributors Framework contributions welcome


Logo

Advanced Building Blocks -Bubble-Sort

Our implementation of the Bubble Sort Algorithm with Ruby
🖊️ Read the article 🐞 Report a Bug 🙋‍♂️ Request Feature

The Project

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.

In this project, we implemented the bubble sort algorithm. The focus is on the use of yield and passing a block to a method. We created a method that sorts an array. This algorithm has a O(n2) at the worst case scenario. We included another method that accepts a block to sort an array of strings by length.

You need to have Ruby installed in your computer to run this file. Also you can run it on Repl.it, click below.

Run Code Online

Run on Repl.it

Table of Contents

  1. Validations
  2. Features
  3. Built With
  4. Authors
  5. Contributing
  6. Show your support
  7. License

Validations

Rubocop:

rubocop-validation

Features

  • Method #bubble_sort that takes an array and returns a sorted array. It must use the bubble sort methodology
  • A similar method called #bubble_sort_by which sorts an array by accepting a block.
  • Both Methods accepting a block using yield()
  • Basic tests on methods
  • %W operator for array of strings

Built With

  • ruby v2.5.5+
  • RVM
  • vscode with Ruby and Rubocop extensions
  • Linux
  • Love and Passion for code.

Authors

Contributing

contributions welcome

🤝 Contributions, issues and feature requests are welcome! Feel free to check the issues page.

Show your support

🤗 Give a ⭐️ if you like this project!

Icons from:

Icons8

License

License

📝 This project is licensed under the MIT
Feel free to fork this project and improve it - see the LICENSE.md file for details