欢迎来到天天文库
浏览记录
ID:33508305
大小:76.04 KB
页数:4页
时间:2019-02-26
《数据结构与算法分析课后答案》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、课后答案网,用心为你服务!大学答案---中学答案---考研答案---考试答案最全最多的课后习题参考答案,尽在课后答案网(www.khdaw.com)!Khdaw团队一直秉承用心为大家服务的宗旨,以关注学生的学习生活为出发点,旨在为广大学生朋友的自主学习提供一个分享和交流的平台。爱校园(www.aixiaoyuan.com)课后答案网(www.khdaw.com)淘答案(www.taodaan.com)Chapter1:Introduction1.3Becauseofround-offerrors,itiscustomarytospecifythen
2、umberofdecimalplacesthatshouldbeincludedintheoutputandroundupaccordingly.Otherwise,numberscomeoutlookingstrange.Weassumeerrorcheckshavealreadybeenperformed;theroutineSeparateOislefttothereader.CodeisshowninFig.1.1.1.4ThegeneralwaytodothisistowriteaprocedurewithheadingvoidProce
3、ssFile(constchar*FileName);whichopensFileName,Odoeswhateverprocessingisneeded,andthenclosesit.Ifalineoftheform#includeSomeFileisdetected,thenthecallProcessFile(SomeFile);ismaderecursively.Self-referentialincludescanbedetectedbykeepingalistof®lesforwhichacalltoProcessFileOhasno
4、tyetterminated,andcheckingthislistbeforemakinganewcalltoProcessFile.O1.5(a)Theproofisbyinduction.Thetheoremisclearlytruefor05、ethetheoremistrueforpO6、esumis4/3andfollowsdirectlyfromtheformula.__1___2___3__2___3(b)SO=+++....4SO=1+++....Subtractingthe®rstequationfrom44243442__1___2thesecondgives3SO=1+++....Bypart(a),3SO=4/3soSO=4/9.442__1___4___9__4___9___16(c)SO=+++....4SO=1++++....Subtractingthe®rstequa-4424344243__3___5___7、7tionfromthesecondgives3SO=1++++....Rewriting,weget44243¥___i¥___13SO=2SiO+SiO.Thus3SO=2(4/9)+4/3=20/9.ThusSO=20/27.iO=04iO=04¥iONO___(d)LetSNO=SiO.Followthesamemethodasinparts(a)-(c)toobtainaformulaforSNOiO=04intermsofSNO-1,SNO-2,...,SO0andsolvetherecurrence.Solvingtherecurre8、nceisverydif®cult.-1-________________________________________
5、ethetheoremistrueforpO6、esumis4/3andfollowsdirectlyfromtheformula.__1___2___3__2___3(b)SO=+++....4SO=1+++....Subtractingthe®rstequationfrom44243442__1___2thesecondgives3SO=1+++....Bypart(a),3SO=4/3soSO=4/9.442__1___4___9__4___9___16(c)SO=+++....4SO=1++++....Subtractingthe®rstequa-4424344243__3___5___7、7tionfromthesecondgives3SO=1++++....Rewriting,weget44243¥___i¥___13SO=2SiO+SiO.Thus3SO=2(4/9)+4/3=20/9.ThusSO=20/27.iO=04iO=04¥iONO___(d)LetSNO=SiO.Followthesamemethodasinparts(a)-(c)toobtainaformulaforSNOiO=04intermsofSNO-1,SNO-2,...,SO0andsolvetherecurrence.Solvingtherecurre8、nceisverydif®cult.-1-________________________________________
6、esumis4/3andfollowsdirectlyfromtheformula.__1___2___3__2___3(b)SO=+++....4SO=1+++....Subtractingthe®rstequationfrom44243442__1___2thesecondgives3SO=1+++....Bypart(a),3SO=4/3soSO=4/9.442__1___4___9__4___9___16(c)SO=+++....4SO=1++++....Subtractingthe®rstequa-4424344243__3___5___
7、7tionfromthesecondgives3SO=1++++....Rewriting,weget44243¥___i¥___13SO=2SiO+SiO.Thus3SO=2(4/9)+4/3=20/9.ThusSO=20/27.iO=04iO=04¥iONO___(d)LetSNO=SiO.Followthesamemethodasinparts(a)-(c)toobtainaformulaforSNOiO=04intermsofSNO-1,SNO-2,...,SO0andsolvetherecurrence.Solvingtherecurre
8、nceisverydif®cult.-1-________________________________________
此文档下载收益归作者所有