Skip to content

wiggle sort seems incorrect #988

@BranAndSceolan

Description

@BranAndSceolan

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    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