离散数学北京邮电大学.ppt

离散数学北京邮电大学.ppt

ID:56304404

大小:914.00 KB

页数:114页

时间:2020-06-10

离散数学北京邮电大学.ppt_第1页
离散数学北京邮电大学.ppt_第2页
离散数学北京邮电大学.ppt_第3页
离散数学北京邮电大学.ppt_第4页
离散数学北京邮电大学.ppt_第5页
资源描述:

《离散数学北京邮电大学.ppt》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、AlgorithmsRosen6thed.,§3.1Abual-Khowarizmi (ca.780-850)Chapter3:MoreFundamentals§3.1:AlgorithmsFormalprocedures§3.2:GrowthofFunctions§3.3:ComplexityofalgorithmsAnalysisusingorder-of-growthnotation.§3.4:TheIntegers&DivisionSomebasicnumbertheory.§3.5:PrimesandGre

2、atestCommonDivisors§3.6:Integers&AlgorithmsAlternatebases,algorithmsforbasicarithmetic§3.7:ApplicationsofNumbertheoryPublic-KeyCryptography§3.8:MatricesSomebasiclinearalgebra.§3.1:AlgorithmsThefoundationofcomputerprogramming.Mostgenerally,analgorithmjustmeansad

3、efiniteprocedureforperformingsomesortoftask.Acomputerprogramissimplyadescriptionofanalgorithm,inalanguagepreciseenoughforacomputertounderstand,requiringonlyoperationsthatthecomputeralreadyknowshowtodo.Wesaythataprogramimplements(or“isanimplementationof”)itsalgo

4、rithm.AlgorithmsYouAlreadyKnowGrade-schoolarithmeticalgorithms:Howtoaddanytwonaturalnumberswrittenindecimalonpaper,usingcarries.Similar:Subtractionusingborrowing.Multiplication&longdivision.Yourfavoritecookingrecipe.HowtoregisterforclassesatBUPT.ProgrammingLang

5、uagesSomecommonprogramminglanguages:Newer:Java,C,C++,C#,VisualBasic,JavaScript,Perl,Tcl,Pascal,manyothers…Older:Fortran,Cobol,Lisp,BasicAssemblylanguages,forlow-levelcoding.Inthisclasswewilluseaninformal,Pascal-like“pseudo-code”language.Youshouldknowatleast1rea

6、llanguage!AlgorithmExample(English)Task:Givenasequence{ai}=a1,…,an,aiN,saywhatitslargestelementis.Onealgorithmfordoingthis,inEnglish:Setthevalueofatemporaryvariablev(largestelementseensofar)toa1’svalue.Lookatthenextelementaiinthesequence.Ifai>v,thenre-assignvt

7、othenumberai.Repeatthenprevious2stepsuntiltherearenomoreelementsinthesequence,&returnv.ExecutinganAlgorithmWhenyoustartupapieceofsoftware,wesaytheprogramoritsalgorithmarebeingrunorexecutedbythecomputer.Givenadescriptionofanalgorithm,youcanalsoexecuteitbyhand,by

8、workingthroughallofitsstepswithpencil&paper.Before~1940,“computer”meantapersonwhosejobwastoexecutealgorithms!ExecutingtheMaxalgorithmLet{ai}=7,12,3,15,8.Finditsmaximum…Setv=

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

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

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