Add function documentation to bucketSort

This commit is contained in:
Charlie Moore
2021-10-04 18:27:17 -04:00
parent 754f7b6b04
commit 269175689f

View File

@ -11,6 +11,14 @@ Time Complexity of Solution:
Best Case O(n); Average Case O(n); Worst Case O(n)
*/
/**
* bucketSort returns an array of numbers sorted in increasing order.
*
* @param {number[]} list The array of numbers to be sorted.
* @param {number} size The size of the buckets used. If not provided, size will be 5.
* @return {number[]} An array of numbers sorted in increasing order.
*/
function bucketSort (list, size) {
if (undefined === size) {
size = 5