Skip to content

Commit 4490ed0

Browse files
author
Antonia Strack
committed
Add comments with demonstration of behaviour.
1 parent 6d32268 commit 4490ed0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sorts/WiggleSort.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +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(wiggleSort([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(wiggleSort([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(wiggleSort([1, 1, 1, 2, 2]))
4747
// [ 1, 2, 1, 2, 1 ]
48-
console.log(wiggleSort([1, 1, 2, 2, 2]))
48+
// console.log(wiggleSort([1, 1, 2, 2, 2]))
49+
// [ 1, 2, 1, 2, 2 ]
50+
// console.log(wiggleSort([3, 5, 6, 1]))
51+
// [ 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