算法导论-MIT笔记

第一部分 Analysis of Algorithms

  算法分析是关于计算机程序性能(performance)和资源利用的理论研究

1 What's more important than performance?

|-Correctness正确性

|-Simplicity简洁性

|-Maintainability可维护性

|-Robustness鲁棒性

|-Features(Functionality、Modularity)

|-Security

|-Scalability可扩展性

|-User-friendly

2 Problem sorting Time= O(n2)

2.1 Insertion sort

①Running time

|-Depends on input

|-Depends on input size

||-parameterize in input size

-want upper bounds运行时间上界

②Kinds of analysis

|-Worst case(usually)

|-Average case(sometimes)

||-need assumption of statistical distribution of inputs

|-Best case(bogus假象)

③Asymptotic analysis渐近分析

|-忽略依赖于极其的常量

|-关注运行时间的增长growth

-渐近符号(补充)

2.2 Merge sort归并排序 Time=O(nlgn)

-Recursion tree 推导

 

posted @ 2016-12-13 14:21  Dr.Yuan  阅读(240)  评论(0编辑  收藏  举报