您的位置:首页 > 其它

[转载]freeSwitch基本操作(转载)

2015-12-14 12:03 197 查看
1.  Greedy Algorithms : Iteratively make "myopic" decisions, hope everything works out at the end.

    Example: Dijkstra's shortest path algorithm (processed each destination once, irrevocably)

 

2.  Contrast with Divide & Conquer

    a)  Easy to propose multiple greedy algorithms for many problems.

    b)  Easy running time analysis.

    c)  Hard to establish correctness. (Most greedy algorithms are NOT correct.)

 

3.  Proofs of Correctness :

    a)  Induction. ( i.e. correctness proof for Dijkstra's algorithm)

    b)  "Exchange argument"

         -- by Contradiction ( to assume there is some optmial algorithms else )

         --  convert the assumed optimial algorithms to the one to be prooved without making it worse

 

4.  The Optimal Caching Algorithm :

    Theorem: The "furthest-in-future" algorithm is optimal (i.e., minimizes the number of cache misses).

    1.  Serves as guideline for practical algorithms (e.g., Least Recently Used (LRU) should do well  provided data exhibits locality of reference).

    2.  Serves as idealized benchmark for caching algorithms.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: