Algorithm (4th edition)-1.4.6 times magnification test

Source: Internet
Author: User

Summary: This section describes the realization and effect of magnification test.

Focus:

1. The realization of magnification test:

· Develop an input generator to produce various possible inputs in real-world situations.

· Run the program, which calculates the ratio of each experiment to the last run time.

· Repeated operations know that the ratio is approaching the limit 2^b.

This experiment is ineffective for algorithms with no limit to the ratio, but it still applies to many programs, and we can draw the following conclusions:

· Their operating time is increasing in order of approximately n^b.

· To predict the run time of a program, multiply the last observed run time by 2^b and double the n, so repeat. If you want the predicted input model to be not a power of n multiplied by 2, you can adjust the scale accordingly.

2. Understanding the growth of the program's uptime can provide you with accurate information to understand the limits of the size of the problem you can solve.

3. Forecasts based on an increasing order of magnitude function:

Describe Function Coefficient is 2 Coefficient is 10
Linear level N 2 10
Linear logarithm level Nlogn 2 10
Square level N^2 4 100
Cubic level N^3 8 1000
Index level 2^n 2^n 2^9n

Algorithm (4th edition)-1.4.6 times magnification test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.