更改

跳到导航 跳到搜索
添加43字节 、 2021年1月26日 (二) 20:46
第270行: 第270行:  
A nonlinear lower bound of <math>\Omega(n\log n)</math> is known for the number of comparisons needed for a sorting algorithm. Thus the best sorting algorithms are optimal, as their complexity is <math>O(n\log n).</math> This lower bound results from the fact that there are  ways of ordering  objects. As each comparison splits in two parts this set of  orders, the number of  of comparisons that are needed for distinguishing all orders must verify <math>2^N>n!,</math> which implies <math>N =\Omega(n\log n),</math> by Stirling's formula.
 
A nonlinear lower bound of <math>\Omega(n\log n)</math> is known for the number of comparisons needed for a sorting algorithm. Thus the best sorting algorithms are optimal, as their complexity is <math>O(n\log n).</math> This lower bound results from the fact that there are  ways of ordering  objects. As each comparison splits in two parts this set of  orders, the number of  of comparisons that are needed for distinguishing all orders must verify <math>2^N>n!,</math> which implies <math>N =\Omega(n\log n),</math> by Stirling's formula.
   −
<math>\Omega(n\log n)</math>的一个非线性下界是已知的'''<font color="#ff8000">排序算法 sorting algorithm</font>'''所需的比较次数。由于{{mvar|n}}个对象有{{math|''n''!}}种排序方式,当它们的复杂度是<math>O(n\log n).</math>时,最好的排序算法都是最优的。当每个比较被分成两部分时,区分所有比较序列所需的比较数量必须验证 < math > 2 ^ n > n!,这意味着 < math > n = Omega (n log n) </math > Stirling 的公式。
+
<math>\Omega(n\log n)</math>的一个非线性下界是已知的'''<font color="#ff8000">排序算法 sorting algorithm</font>'''所需的比较次数。由于{{mvar|n}}个对象有{{math|''n''!}}种排序方式,当它们的复杂度是<math>O(n\log n).</math>时,最好的排序算法都是最优的。由于每次比较结果都会被分成两部分,即一组{{math|''n''!}}次序,则区分所有比较序列所需的比较次数必须满足<math>2^N>n!,</math> ,这意味着<math>N =\Omega(n\log n),</math>,由 Stirling 公式得出。
     
307

个编辑

导航菜单