Hello guys, I really want your help cause im confused. So what i need to do is to write a program that randomise array and after that the first numbers need to be odds and on ascending order, after them the numbers need to be even and again on ascending order. Here is an example of an input "7 2 5 1 8 4" and the expected output need to be "1 5 7 2 4 8" , Im getting "1 5 7 8 4 2".
Here is my code.
If you can use them, the algorithms std::sort() and std::stable_partition() will do what you want. If you cannot, then take a look at the reference implementations of each for hints about how to make it work.