算法

An algorithm is an unambiguous specification of how to solve a class of problems.

Algorithms can perform calculation, data processing and automated reasoning tasks.

算法分析

Analysis of algorithms is the determination of the computational complexity of algorithms, that is the amount of time, storage and/or other resources necessary to execute them.

Usually, this involves determining a function that relates the length of an algorithm’s input to the number of steps it takes (its time complexity) or the number of storage locations it uses (its space complexity).

An algorithm is said to be efficient when this function’s values are small. Since different inputs of the same length may cause the algorithm to have different behavior, the function describing its performance is usually an upper bound on the actual performance, determined from the worst case inputs to the algorithm.

时间复杂度

时间复杂度

如何理解算法时间复杂度的表示法O(n²)、O(n)、O(1)、O(nlogn)等?

十分钟搞定时间复杂度