时间复杂性 [英] time complexity

查看:97
本文介绍了时间复杂性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我重新设计的概念1.时间复杂度2.worst case 3.average case。

这些术语与处理器或内存有关吗?

please tell me the concept regrading 1.time complexity 2.worst case 3.average case.
these term related to the processor or memory?

推荐答案


请告诉我重新评估的概念1.time复杂度2.worst case 3.average case。

这些术语与处理器还是内存?
please tell me the concept regrading 1.time complexity 2.worst case 3.average case.
these term related to the processor or memory?



1.我真的不知道我会猜出变化有多大,混乱是多么混乱

2.最糟糕的case是使用的最大资源

3.平均情况是使用的平均资源


对于处理器来说这通常就处理器的内存时间而言将是使用的内存量。

1. I don''t really know I would guess at how much variation and how chaotic that variatin was
2. The worst case is the maximum resource used
3. The average case is the average resource used

For the processor this is normally in terms of processor time for memory it will be amount of memory used.


亲爱的,
时间复杂度与处理器有关,意味着处理器执行任何程序所花费的时间.max 。所花费的时间是最坏的情况,平均情况取决于某个位置特定项目的出现概率。
dear,
time complexity is related to processor, means how much time is taken by the processor to execute any program.max. time taken is worst case and average case is depending on the probability of occurance of particular item at a location.


在算法分析中,资源的界限,即时间(相关)处理器)和空间(与存储器相关),使用像Big-O,Omega等的非对称符号来测量。这些分别称为时间复杂度和空间复杂度。通常这些是作为输入大小的函数来测量的。


实际上,这些度量并不准确计算程序使用多少时间或空间。 (这些也不是我们关心的问题。而且,如果我们想要,我们可以使用一个简单的程序来测量它。)相反,它们告诉我们随着输入大小的增长,运行时间是如何增长的。例如,merge-sort的时间复杂度为O(nlogn),而插入排序的时间复杂度为O(n ^ 2)。话虽如此,我们可以说合并排序比插入排序好得多。但我们不能用公式中的n值代替并获得运行时间。这同样适用于空间复杂性。


其他问题已经得到解答。希望这会有所帮助。
In the analysis of algorithms, the bounds on the resources, i.e., time (related to processor) and space (related to memory) , are measured using asymtotic notations like Big-O, Omega etc. These are called time-complexity and space complexity respectively. Normally these are measued as a function of the input size.

Actually, these measures do not compute accurately how much time or space is used by a program. (These are not our concern either. Moreover, if we want we can measure this using a simple program.) In contrast, they tell us how the running time is growing as the input-size grows. For example, the time complexity of merge-sort is O(nlogn) while the time complexity of insertion sort is O(n^2). Having said this, we can say that the merge sort is much better than insertion sort. But we can not substitute the value of n in the formula and get the running time. The same applies to space complexity too.

The other questions have already been answered. Hope this helps.


这篇关于时间复杂性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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