Sort Colors
Given an array with n objects colored red, white, or blue (represented by 0, 1, and 2), sort them in-place so that objects of the same color are adjacent (Dutch National Flag problem).
Sort Colors

Given an array with n objects colored red, white, or blue (represented by 0, 1, and 2), sort them in-place so that objects of the same color are adjacent (Dutch National Flag problem).

Example 1:
Input: [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Input
arr =[2,0,2,1,1,0]

Dutch National Flag algorithm

lowmidhigh200122131405
low: 0
mid: 0
high: 5
0 = Red
1 = White
2 = Blue
Variables
No variables to display
DepthFunction Call
Stack empty
0/7