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。