Added a new 3-way partition based on N. Lomuto's method