# Bucket Sort Algorithm In Javascript

Bucket (bin) sort is a sorting algorithm that parts an array into buckets. Each of these are sorted recursively with the bucket sorting algorithm. The basic procedure of Bucket Sort is: 1. Create an empty array 2. Loop through the original array and put each object in a “bucket” 3. Sort each of the non-empty buckets 4. Check the buckets in order and then put all objects back into the original array

var array = [2, 4, 1, 5, 3]; bucketSort(array);