上界VS下界的一个算法的最坏情况下的运行时间

编程入门 行业动态 更新时间:2024-10-27 18:25:26
本文介绍了上界VS下界的一个算法的最坏情况下的运行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我学习算法分析。我明白了的最坏情况下的运行时间的算法的概念。

I am learning about analysis of algorithms. I understand the concept of the worst case running time of an algorithm.

然而,在运行的算法的时间上的最坏情况下的上限和下限?

However, what are upper and lower bounds on the worst case running time of an algorithm?

什么可以是一个例子,其中一个的上限的用于运行算法的时间的最坏的情况是,从不同的的下限的运行的同时最坏的情况下算法?

What can be an example where an upper bound for the worst case running time of an algorithm is different from the lower bound for the worst case running time of the same algorithm?

推荐答案

一个函数 F(N), G(N)是上限(大O ),如果对于足够大N, F(N)其​​中​​= C * G(N),对于恒定 C 。 [G主宰F] G(n)是下限(大欧米茄)如果足够大N, F(N)> = C * G(N),对于恒定 C 。 [F主导G]

for a function f(n), g(n) is an upper bound (big O) if for "big enough n", f(n)<=c*g(n), for a constant c. [g dominates f] g(n) is lower bound (big Omega) if for "big enough n", f(n) >= c*g(n), for a constant c. [f dominates g]

如果 G(N)既上限和下限的 F(N) [用不同的C的],我们说G(N)是一个严密开往F(N)[大θ1

If g(n) is both upper bound and lower bound of f(n) [with different c's], we say g(n) is a tight bound for f(n) [Big theta]

使用范例上限,而不是紧一:有的时候是很难找到紧约束,例如对的斐波纳契递归算法。因此,我们找到一个简单的上界O(2 ^ n)的,很容易。更多信息以本答案中的post

Use example for upper bound instead of tight one: some times it is hard to find tight bound, such as for the fibonacci recursive algorithm. so we find an easy upper bound of O(2^n), easily. more info is found in answers in this post

更多推荐

上界VS下界的一个算法的最坏情况下的运行时间

本文发布于:2023-11-30 17:05:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650810.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上界   下界   算法   最坏   情况下

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!