Skip to content

Bug Report for quickSort - Incorrect judging due to unstable-order expectation in Quick Sort task #5378

@Antol

Description

@Antol

Specific relative order for equal keys in a Quick Sort problem that explicitly allows instability

The problem statement describes a Quick Sort partition scheme (right-most pivot; < pivot left; >= pivot right) and explicitly notes the output is “not necessarily stable.” However, the judge appears to require an exact ordering among elements with equal keys, causing correct Quick Sort implementations to fail.

Input

pairs=[(5,"apple"), (9,"banana"), (9,"cherry"), (1,"date"), (9,"elderberry")]

Observed (My Output)

[(1,"date"), (5,"apple"), (9,"cherry"), (9,"banana"), (9,"elderberry")]

Expected (Platform Output)

[(1,"date"), (5,"apple"), (9,"elderberry"), (9,"cherry"), (9,"banana")]

Actual behavior

Submission is marked incorrect unless the equal-key elements (key=9) appear in the judge’s preferred order.

Expected behavior

Any output that:

  • is sorted by key ascending, and
  • follows the stated partition rule (< pivot left, >= pivot right),
    should be accepted — without enforcing a particular relative order among equal keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions