DEV Community

Discussion on: Day-7 Sort Array by Parity

Collapse
 
ekologic profile image
Bekzod • Edited

We could have bubble sort with a val % 2 ==0 predicate or a slighty modified version of a Dutch national flag sorting problem, the main idea is to have two pointers. IMO in that case the space complexity should be O(1)