chapter 2 : The Complexity of Algorithms and the Lower Bounds of Problems
2009-11-16 17:53
671 查看
Definition (complexity)
。The space complexity of an algorithm is the amount of memory it needs to run to completion.
。The time complexity of an algorithm is the amount of computer time it needs to run to completion.
。分析算法所需的时间时,不适合用实际的时间来表示,因为每台电脑的执行速度都不相同。
。我们用 program step 来表示一个 program 的执行时间。每个 statement 都算一次。
•For instance: return (a + b + b´c + (a+b-c)/(a+b) + 4.0); 就当作是一个 program step。
。可以在每个 statement 的地方增加一个 counter (global variable),就可以实际算出每个算法的执行步骤。
赋值语句算一个statement
return s 算一个statement。
。The space complexity of an algorithm is the amount of memory it needs to run to completion.
。The time complexity of an algorithm is the amount of computer time it needs to run to completion.
。分析算法所需的时间时,不适合用实际的时间来表示,因为每台电脑的执行速度都不相同。
。我们用 program step 来表示一个 program 的执行时间。每个 statement 都算一次。
•For instance: return (a + b + b´c + (a+b-c)/(a+b) + 4.0); 就当作是一个 program step。
。可以在每个 statement 的地方增加一个 counter (global variable),就可以实际算出每个算法的执行步骤。
赋值语句算一个statement
return s 算一个statement。
相关文章推荐
- MapKit and Text Input(Chapter 5 of iOS Programming: The Big Nerd Ranch Guide)
- TACAS(International Conference on Tools and Algorithms for the Construction and Analysis of Systems)到底是什么档次的会议?
- Types and Declarations(Chapter 4 of The C++ Programming Language)
- The study of chapter 13 in programming windows with mfc-printing with document and views
- Delegation and Core Location(Chapter 4 of iOS Programming: The Big Nerd Ranch Guide)
- Assembling Views and Animations(Chapter 6 of The iPhone™ Developer’s Cookbook)
- Creating, Updating, and Deleting Documents(Chapter 3 of MongoDB The Definitive Guild)
- Library Organization and Containers(Chapter 16 of The C++ Programming Language)
- Introduction to Languages and the Theory of Computation--Chapter 1 学习笔记
- Design and Analysis of Algorithms_Fundamentals of the Analysis of Algorithm Efficiency
- The Relationship of the Frame, Bounds, and Center Properties Of UIVIEW
- Source Files and Programs(Chapter 9 of The C++ Programming Language)
- Handbook of Applied Algorithms: Solving Scientific, Engineering, and Practical Problems
- The Tomes of Delphi: Algorithms and Data Structures
- Multiprocess programming - Lower Bounds on the Number of Locations
- Introduction to The Design and Analysis of Algorithms (1)
- Chapter 1 The Role of Algorithms in Computing
- TACAS(International Conference on Tools and Algorithms for the Construction and Analysis of Systems)到底是什么档次的会议?
- The Anatomy of a COM Server(Chapter 2 of COM and .NET Interoperability) part1
- Time and Space Complexity of Recursive Algorithms