简体   繁体   English

简化算法图

[英]Simplify Algorithm graphs

The below are 3 algorithms for the same problem. 以下是针对相同问题的3种算法。 How can one find the fastest algorithm? 如何找到最快的算法?

在此处输入链接说明

I tried to divide both gradients by log and square root to find the steepest graph. 我试图用对数和平方根除以两个梯度,以找到最陡的图。

I am more comftorable giving guidelines after your comment - it proves you showed some effort. 在您发表评论后,我更乐于提供指导,这证明您付出了很多努力。

You basically want to get to a formula t = f(n) , and chose the one that grows slowest. 您基本上想得到一个公式t = f(n) ,然后选择增长最快的公式。
It can be done by using the information you have with some basic algebra, I will give an example for the rightest graph, and you will need to do the same for the others and get their function. 这可以通过使用一些基本代数中的信息来完成,我将举一个最正确的图的示例,您将需要对其他图做同样的事情并获得它们的功能。

Rightest graph: 最右边的图:
We know that for each increase of 1 in 2^n, there is increase of 4 in 2^t. 我们知道,每增加2 ^ n 1,就会增加2 ^ t 4。 From this: 由此:

2^t/2^n = 4 --> 2^t = 4*2^n --(log)--> log(2^t) = log(4*2^n) --> 
--> t = log(4) + log(2^n) --> t = 2 + n

Use the same technique for the rest, and chose the one that is growing slowest, and you got your answer. 其余使用相同的技术,然后选择增长最慢的一种,您就得到了答案。

Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM