Solution: Dutch National Flag Problem
In this review lesson, we give a detailed analysis of the solutions for the Dutch national flag problem.
We'll cover the following...
We'll cover the following...
Solution #1: Brute force
We have used simple selection sort to rearrange the array in ascending order. This method is naive and does not cater to the fact that we have just three different digits for this problem.
Time complexity
The time complexity is also too high, i.e. ...