Quicksort with 3-way partition

前端 未结 7 1945
野趣味
野趣味 2021-01-31 15:44

What is QuickSort with a 3-way partition?

7条回答
  •  不知归路
    2021-01-31 16:30

    I think it is related to the Dijkstra way of partitioning where the partition is of elemnts smaller, equal, and larger than the pivot. Only the smaller and larger partitions have to be sorted recursively. You can see an interactive visualization and play with it at the walnut. The colors I used there are red/white/blue because the method of partitioning is usually called "the dutch flag problem"

提交回复
热议问题