Concept Flow - Dutch National Flag Three Way Partition
Initialize pointers: low=0, mid=0, high=n-1
Check mid <= high?
No→Done
Yes
Check arr[mid
Swap arr[low
low++, mid++
↩Back to Check mid <= high?
The algorithm uses three pointers to partition the array into three parts: 0s, 1s, and 2s by swapping elements and moving pointers until mid passes high.
