mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Add function documentation to bucketSort
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user