6.1 Dutch national flag problem variant 1

#1

Hi all,

For this variant, I feel like the solution will be the same as one given in the book. However, when I tried that solution with the list A = [0, 1, 2, 0, 2, 1, 1], pivot A[2] = 2, the result was [0, 1, 0, 1, 1, 2, 2]. This result is not true since 0s and 1s do not appear together. Can anyone have any suggestion for this ?

Thanks in advance

0 Likes