Skip to content

Commit db8abd3

Browse files
author
Antonia Strack
committed
Rename filename to be more fitting.
Real wiggle-sort uses the rule arr[0] < arr[1] > arr[2] < arr[3] > arr[4] < ...
1 parent 4490ed0 commit db8abd3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sorts/WiggleSort.js renamed to Sorts/SimplifiedWiggleSort.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
import { quickSelectSearch } from '../Search/QuickSelectSearch.js'
99

10-
export const wiggleSort = function (arr) {
10+
export const simplifiedWiggleSort = function (arr) {
1111
// find Median using QuickSelect
1212
let median = quickSelectSearch(arr, Math.floor(arr.length / 2.0))
1313
median = median[Math.floor(arr.length / 2.0)]
@@ -39,13 +39,13 @@ export const wiggleSort = function (arr) {
3939

4040
// Implementation of wiggle sort
4141

42-
// console.log(wiggleSort([3, 5, 2, 1, 6, 4]))
42+
// console.log(simplifiedWiggleSort([3, 5, 2, 1, 6, 4]))
4343
// [ 3, 5, 2, 6, 1, 4 ]
44-
// console.log(wiggleSort([3, 5, 2, 2, 0, 2]))
44+
// console.log(simplifiedWiggleSort([3, 5, 2, 2, 0, 2]))
4545
// [ 0, 5, 2, 3, 2, 2 ]
46-
// console.log(wiggleSort([1, 1, 1, 2, 2]))
46+
// console.log(simplifiedWiggleSort([1, 1, 1, 2, 2]))
4747
// [ 1, 2, 1, 2, 1 ]
48-
// console.log(wiggleSort([1, 1, 2, 2, 2]))
48+
// console.log(simplifiedWiggleSort([1, 1, 2, 2, 2]))
4949
// [ 1, 2, 1, 2, 2 ]
50-
// console.log(wiggleSort([3, 5, 6, 1]))
50+
// console.log(simplifiedWiggleSort([3, 5, 6, 1]))
5151
// [ 3, 6, 1, 5 ]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy