Bubble Sort Algorithm
There are many algorithms that deal with sorting collections of data. One of the most basic forms of sorting is known as Bubble Sort and is named by it's nature of the order of data having a "bubbling" effect as a collection of data is sorted. We will start off by implementing a Bubble Sort algorithm on a one-dimensional Array.
The trick to remembering bubble sort is to visualize that your array is vertical rather than horizontal. If smaller values are "deeper" in the array, they will "rise" to the top until they are the smallest value. If larger values are "higher" in the array, they will sink to the bottom until they are the largest value.
- Fork this repository to your own Github account.
- Clone down the forked repo from your Github account to your local development environment.
- In the project directory on your local machine, install all the npm modules with
npm install
. - Your answers should go in the bubble-sort.js file.
- Check if the tests pass by entering
npm test
in the terminal.