归并排序的比较次数

单选题 难度 4

#sort#complexity

8 个数归并,两两比较了多少次?

题目

用标准归并排序对 {5,2,8,1,9,3,7,4} 排序,合并过程中「取两边队首比较」这一步一共执行了( )次。
  1. 17
  2. 24
  3. 8
  4. 12
来小码星球,动手写一遍 →