Giter Club home page Giter Club logo

advanced-building-blocks---bubble-sort's Introduction

Advanced-Building-Blocks---Bubble-Sort

This project is the first one in Ruby module at Microverse. In this project, we implemented the bubble sort algorithm. Assignment is focused on the use of yield and passing a block to a method. The project was implemented using two methods. the first method involves creating a variable "is_swapped" and setting it to false. Then Looping through the block with the variable checking if the elements are swapped. The iteration will stop once the variable "is_swapped" becomes true.

The second method uses the yield method with the created variable "sorted" initially set to "false". The yield method is use to pass the two arguments to the block after using the "upto" method to iterate over the length of the array, excluding the last element. If the sorted_blk is positive, then we reverse the order on the array. Once the sorted variable becomes true, the iteration stops and the sorting is complete.

onlineCodingDirectory-screen-shot

Built With

  • Ruby

Getting Started

This project involves using the ruby logics to sort a list of arr into order.

Prerequisites

To get this project up and running, you must have Ruby installed on your machine.

Installation

To get this project set up on your local machine, follow these simple steps:

  • Clone the github repository [email protected]:daviidy/Advanced-Building-Blocks---Bubble-Sort.git on your local machine
  • Cd into the clone folder
  • Add Ruby github/workflows
  • After creating the bubble_sort method and the bubble_sort_by method on the clone folder.
  • Install ruby extension pack on your IDE or code editor
  • right click and click run to test your codes if it passed the test. If passed;
  • Run rubocop on your working folder
  • Fix errors
  • stage, commit, push to the created remote branch(feature-branch) on github and create a pull request.

Author

๐Ÿ‘ค Eric Enaburekhan

๐Ÿ‘ค David Yao

Show your support

If you've read this far, you must like the project! Give me a โญ๏ธ!

Acknowledgments

  • My thanks also goes to Microverse and all our peers and colleagues there.

advanced-building-blocks---bubble-sort's People

Contributors

daviidy avatar enaburekhan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

enaburekhan

advanced-building-blocks---bubble-sort's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.