bubble-sort-js
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "bubble-sort-js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Bubble Sort algorithm javascript implementation. ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,5 +18,3 @@ # Bubble Sort | ||
// Ascending order | ||
bubblesort([3,1,4,1,5,9,2,6,5,4]); | ||
@@ -33,3 +31,2 @@ // => [1,1,2,3,4,4,5,5,6,9] | ||
// Descending order | ||
function comparator(a, b) { return b - a; } | ||
@@ -45,2 +42,3 @@ | ||
// Ascending sort arrays of objects | ||
function orderImages(a, b) { return a.order - b.order }; | ||
@@ -54,13 +52,11 @@ const images = [ | ||
function orderImages(a, b) { return a.order - b.order }; | ||
bubblesort(people, comparePeople); | ||
bubblesort(images, orderImages); | ||
/* | ||
=> [ | ||
{href: 'http://path/to/something/terrifik', caption: 'Terrifik', order: 1}, | ||
{href: 'http://path/to/something/amazing', caption: 'Amazing', order: 2}, | ||
{href: 'http://path/to/something/crazy', caption: 'Crazy', order: 3}, | ||
{href: 'http://path/to/something/awesome', caption: 'Awesome', order: 4} | ||
] | ||
{href: 'http://path/to/something/terrifik', caption: 'Terrifik', order: 1}, | ||
{href: 'http://path/to/something/amazing', caption: 'Amazing', order: 2}, | ||
{href: 'http://path/to/something/crazy', caption: 'Crazy', order: 3}, | ||
{href: 'http://path/to/something/awesome', caption: 'Awesome', order: 4} | ||
] | ||
*/ | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5612
59