The Dutch Flag Problem

This is a classical sorting problem, constituting a variation over the insertion sort.