Skip to content
New issue

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

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

Already on GitHub? # to your account

ED-001: Dutch national flag problem #258

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant