是否有任何公式可以计算快速排序算法将采用的传递次数? [英] Is there any formula to calculate the no of passes that a Quick Sort algorithm will take?

查看:40
本文介绍了是否有任何公式可以计算快速排序算法将采用的传递次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用快速排序算法时,我想知道是否有任何公式或某种东西可用于查找特定值集按升序完全排序可能需要的传递次数.

While working with Quick Sort algorithm I wondered whether any formula or some kind of stuff might be available for finding the no of passes that a particular set of values may take to completely sorted in ascending order.

是否有任何公式可以计算快速排序算法的通过次数?

Is there any formula to calculate the no of passes that a Quick Sort algorithm will take?

推荐答案

任何给定的值集都将有不同数量的操作,这取决于枢轴值选择方法和排序的实际值.

Any given set of values will have a different number of operations, based on pivot value selection method, and the actual values being sorted.

所以...不,除非'O(N log(N)) 和O(N^2)'之间的近似值足够好.

So...no, unless the approximations of 'between O(N log(N)) and O(N^2)' is good enough.

必须对平均情况与最坏情况进行限定应该足以表明确定操作数量的唯一方法是实际运行快速排序.

That one has to qualify the average versus worst case should be enough to show that the only way to determine the number of operations is to actually run the quicksort.

这篇关于是否有任何公式可以计算快速排序算法将采用的传递次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆