Question: We consider two algorithms that carry out the same computation. Algorithm 1 needs 1 0 0 n flops and algorithm 2 needs n 2 flops.

We consider two algorithms that carry out the same computation.
Algorithm 1 needs 100n flops and algorithm 2 needs n2 flops.
Considering only the flops to determined the speed of the algorithm, which of the following is correct?
If n is larger than 100, then algorithm 1 is faster.
Algorithm 1 is always faster
It cannot be decided which algorithm is faster

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!