计算机算法导论_第4章

计算机算法导论_第4章

ID:37924654

大小:1.14 MB

页数:53页

时间:2019-06-02

计算机算法导论_第4章_第1页
计算机算法导论_第4章_第2页
计算机算法导论_第4章_第3页
计算机算法导论_第4章_第4页
计算机算法导论_第4章_第5页
资源描述:

《计算机算法导论_第4章》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、IntroductiontoAlgorithms计算机算法导论2007~2008年第一学期HomeworkExercises3.2-4;3.2-7Problems3-4RecurrencesRecurrencesThreemethodsforsolvingrecurrencesSubstitutionmethodRecursion-treemethodMastermethodRecurrencesExampleSolvingrecurrencesTheanalysisofmergesortfromLec

2、ture1requiredustosolvearecurrence.Recurrencesarelikesolvingintegrals,differentialequations,etc.Lecture2:Applicationsofrecurrencestodivide-and-conqueralgorithms.TechnicalitiesAssumptionofintegerargumentsoffunctionsBoundaryconditionsFloorsandceils4.1Thesub

3、stitutionmethodSubstitutionmethodThemostgeneralmethod:1.Guesstheformofthesolution.2.Useinductiontofindtheconstantsandshowthatthesolutionworks.SubstitutionmethodGuess:T(n)=nlgn+nSubstitutionmethodMakingagoodguessT(n)=2T(n/2+17)+nSimilarsolutionisreasonabl

4、eProvelooseupperandlowerboundsandreducetherangeofuncertaintySubtletiesT(n)=2T(n/2)+1AvoidingpitfallsT(n)≦2c(n/2)+n=cn+n=O(n)Wrong!!!!ChangingvariablesAnexampleAnexampleAnexample4.2Therecursion-treemethodAnexampleT(n)=T(n/3)+T(2n/3)+Θ(n)AnexampleT(n)=T(n/

5、3)+T(2n/3)+Θ(n)AnexampleT(n)=T(n/3)+T(2n/3)+Θ(n)AnexampleT(n)=T(n/3)+T(2n/3)+Θ(n)4.3ThemastermethodHomeworkExercises4.1-2;4.1-54.2-44.3-1;4.3-2Problems4-1;4-4

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。