Introduction to data structure and algorithm analysis

Source: Internet
Author: User

Data structure + algorithm = Program
Logical Structure: Set, linear, tree, graph Physical Structure:sequential, chain-
Algorithm Analysis:
    • (progressive) complexity of time :
number of executions of the base statement(Basic statement: A statement that is proportional to the number of execution times of the entire algorithm, usually the loop body of the most inner loop)
    1. non-recursive : find the most frequently executed basic statement into the large O;
    2. recursion : (iterative method) The right side of the expanded equation can be iterated, until there are no items to iterate, then the solution of the equation is estimated by estimating the right and http://www.cnblogs.com/ Python27/archive/2011/12/09/2282486.html
 Best case, worst case, average case (probability) common time complexity:
    • (progressive) spatial complexity :
When the algorithm executesTemporaryOpen up the auxiliary space (about the complexity of time and space aSome points of note for ACM:
    • Complexity of Time :
Important fact: the contemporary computer 1s can do 10^7 around the calculation;the machine can be configured to k*10^7~10^8. Under this limitation, there is a limit to the size of the time-complexity algorithm that can be processed:
    • Complexity of space :
The maximum space limit of contemporary 32-bit PC is generally 10^7BYTE≈10MB, for example, you can open several integer arrays of size 10^6: int a[10^6]; Open larger arrays, such as a[10^7] will generally encounter memory Limit exceed; Even if no memory is limited by the number of previous operations, the time complexity is not good: spatial complexity (two common spatial overflow errors): 1, Stack Overflow (recursive program):recursive procedures are common;In most cases you don't have to worry about stack overflow issues2. Open a large array in the function:solution opens into a global array 



From for notes (Wiz)



Introduction to data structure and algorithm analysis

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.