Quicksort with 3-way partition

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

What is QuickSort with a 3-way partition?

7条回答
  •  余生分开走
    2021-01-31 16:17

    if you really grind out the math using Akra-Bazzi formula leaving the number of partitions as a parameter, and then optimize over that parameter, you'll find that e ( =2.718...) partitions gives the fastest performance. in practice, however, our language constructs, cpus, etc are all optimized for binary operations so the standard partitioning to two sets will be fastest.

提交回复
热议问题