Hello! From the comments on the wiggle sort code I got that it is intended to sort an array arr like this: a[0] <= a[1] >= a[2] <= a[3] >= a[4] <=... I tested the code using an array [3, 5, 6, 1]. I got [3, 6, 5, 1], which is not fulfilling the condition stated above. There are possible solutions for this case, for example [3, 5, 1, 6]. If this is an error I would like to try and fix it. If it is not, please reply, so I might learn what I misinterpreted.
Activity
appgurueu commentedon Apr 20, 2022
You're right, this is a bug. Feel free to fix it.
BranAndSceolan commentedon Apr 20, 2022
I am already working on a wriggle sort in java, therefore I would be happy to be assigned to this issue too.