简体   繁体   中英

Simplify Algorithm graphs

The below are 3 algorithms for the same problem. 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.
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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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