Skip to content

ED-001: Dutch national flag problem #258

Closed
@hamidgasmi

Description

@hamidgasmi

Given an array of 0s, 1s, 2s, could you come up with a linear and in place algorithm to sort the array in ascending order.

You're not allowed to use counting sort.

E.g.
- Input: [1, 0, 2, 1, 0]
- Output: [0 0 1 1 2]

For more details

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions