mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
changes
This commit is contained in:
@ -6,7 +6,7 @@ https://en.wikipedia.org/wiki/Pigeonhole_sort
|
|||||||
* (n) and the length of the range of possible key values (N)
|
* (n) and the length of the range of possible key values (N)
|
||||||
* are approximately the same.
|
* are approximately the same.
|
||||||
*/
|
*/
|
||||||
function pigeonhole_sort (arr) {
|
function pigeonHoleSort(arr) {
|
||||||
let min = arr[0]
|
let min = arr[0]
|
||||||
let max = arr[0]
|
let max = arr[0]
|
||||||
|
|
||||||
@ -33,6 +33,6 @@ function pigeonhole_sort (arr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Driver code
|
// Driver code
|
||||||
const arr = Array(8, 3, 2, 7, 4, 6, 8)
|
const arr = [8, 3, 2, 7, 4, 6, 8]
|
||||||
pigeonhole_sort(arr)
|
pigeonHoleSort(arr)
|
||||||
console.log(arr)
|
console.log(arr)
|
||||||
|
Reference in New Issue
Block a user