Skip to content

ED-001: Dutch national flag problem #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hamidgasmi opened this issue Aug 4, 2020 · 0 comments
Closed

ED-001: Dutch national flag problem #258

hamidgasmi opened this issue Aug 4, 2020 · 0 comments

Comments

@hamidgasmi
Copy link
Owner

hamidgasmi commented Aug 4, 2020

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

@hamidgasmi hamidgasmi self-assigned this Aug 4, 2020
hamidgasmi pushed a commit that referenced this issue Aug 4, 2020
@hamidgasmi hamidgasmi changed the title Dutch national flag problem GT-001: Dutch national flag problem Aug 4, 2020
@hamidgasmi hamidgasmi changed the title GT-001: Dutch national flag problem ED-001: Dutch national flag problem Aug 4, 2020
hamidgasmi pushed a commit that referenced this issue Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant