问题标签 [master-theorem]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
25074 浏览

algorithm - 使用主定理求解递归 T(n) = T(n / 2) + O(1)?

我正在尝试解决递归关系以找出使用主定理及其递归概念的算法的复杂性,我如何证明:

T(n) = T(n/2)+O(1)

T(n) = O(log(n)) ?

任何解释将不胜感激!!

0 投票
2 回答
2919 浏览

algorithm - 求解递归:T(n)=sqrt(2)T(n/2)+log(n)

给定方程T(n)=sqrt(2)T(n/2)+log(n)

解决方案指向复杂度等级为 O(sqrt(n)) 的 MT 案例 1。然而,在我的理解之后,log(n) 是大于 sqrt(n) 的多项式。我错过了什么吗?

我使用的定义如下:n^e = log_b(a) 其中 a = sqrt(2) 和 b = 2。这将给我 e = 1/2 < 1。log n 显然是大于 n^e 的多项式。

0 投票
1 回答
1052 浏览

master-theorem - 伪代码主方法算法分析

通过检查这个伪代码,你如何找到主定理中使用的 c/d 常数?

0 投票
1 回答
840 浏览

algorithm - 具有 25%-75% 拆分的随机快速排序枢轴选择

我开始知道,在随机快速排序的情况下,如果我们以这样一种方式选择枢轴,它至少会给出 25%-75% 的比例分配,那么运行时间是O(n log n). 现在我也开始知道我们可以用 Master Theorem 证明这一点。

但我的问题是,如果我们在每一步中将数组拆分为 25%-75%,那么我将如何定义我的T(n)以及如何证明运行时分析O(n log n)

0 投票
1 回答
819 浏览

c++ - 如何找到该算法的时间复杂度?

它的时间复杂度是 O(log n) 还是 O(n) ?

请帮我。

0 投票
1 回答
299 浏览

data-structures - 主定理 - 第二种情况

给定以下递归方程:

我可以很容易地看到这两个方程都符合主定理的第二种情况,

但由于 sin 是一个循环函数,似乎足够大的 N 可能会使它非常接近于零。因此,我们将始终能够为两个常数 c1、c2(根据 theta 定义)找到 N > N0,这将不赞成它。

用主定理真的可以解决吗?

谢谢

0 投票
2 回答
102 浏览

algorithm - What is the runtime of the following recursive algorithm using the Master Theorem?

I'm not particularly sure about the runtime of the following algorithm:

I think this would be O(n) by the Master Theorem but I don't know whether n/logn is asymptotically equal to n. Can someone explain it?

0 投票
2 回答
765 浏览

recurrence - 求解复杂的递归关系

如何解决以下递归关系?

最好通过主定理,否则通过任何方法。我知道 Master Theorem 失败了,但是这些类型的问题是否有任何扩展?你能指导我解决上述复杂关系的任何东西吗?

0 投票
2 回答
758 浏览

algorithm - 算法复杂度,求解递归方程

我正在学习数据结构和算法课程,但我陷入了这个递归方程:

显然这不能通过使用主定理来处理,所以我想知道是否有人对求解这个递归方程有任何想法。我很确定应该通过更改参数来解决它,例如将 n 视为 2^m ,但我无法找到任何好的解决方法。

0 投票
1 回答
801 浏览

math - 当存在三个术语时应用主定理?

我将如何使用主定理解决这种递归?

T(n) = 4T(n/2) + n 2 + logn

我不知道该怎么做,但我很确定可以使用 Master Theorem 解决它。我必须忽略其中一个条款吗?任何帮助表示赞赏,谢谢。