算法经典- 算法导论(Introduction to Algorithms)

作者 Thomes Cormen, Charles Leiserson, Ronald Rivest, Clifford Stein. 去四位作者名称首字母,简写为 CLRS。


The book starts with an algorithm analysis of sorting algorithms.

In chapter 3 they provide definition of time/space complexity of algorithms.


Chapter 4. Divide and Conquer.


Using the idea of divide and conquer they introduces the classic sorting algorithms: heap sort and quick sort.


Heap sort: based on a basic data structure: complete binary tree.

Key: heap-maxify. using it recursively.


Quick sort: worst case: O(n^2). But it works very well practically.

Key: the choice of petition value.

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐