欢迎来到天天文库
浏览记录
ID:21473002
大小:5.54 MB
页数:47页
时间:2018-10-22
《第6章计算机学科基础》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter6ProblemSolvingandAlgorithmDesign问题求解和算法设计ChapterGoals本章目标Determinewhetheraproblemissuitableforacomputersolution确定一个问题是否适合用计算机解决Describethecomputerproblem-solvingprocessandrelateittoPolya’sHowtoSolveItlist结合Polya提出的如何解决问题的列表,描述计算机问题求解的步骤Distingu
2、ishbetweenfollowinganalgorithmanddevelopingone区别执行算法和开发算法Applytop-downdesignmethodologytodevelopanalgorithmtosolveaproblem应用自顶向下的方法开发算法来解决问题2ChapterGoalsDefinethekeytermsinobject-orienteddesign定义面向对象设计方法中的术语Applyobject-orienteddesignmethodologytodevelop
3、acollectionofinteractingobjectstosolveaproblem应用面向对象的方法开发一组互动对象来解决问题Discussthefollowingthreadsastheyrelatetoproblemsolving:informationhiding,abstraction,namingthings,andtesting求证与问题求解相关的几点思想3ProblemSolving问题求解ProblemsolvingTheactoffindingasolutiontoaper
4、plexing,distressing,vexing,orunsettledquestion问题求解:找到令人感到困惑的难题的解决方案的行动。4ProblemSolving问题求解G.PolyawroteHowtoSolveIt:ANewAspectofMathematicalMethod《如何解决它:数学方法的新视点》HisHowtoSolveItlistisquitegeneral他的“如何解决它”这个列表是普遍适用的Writteninthecontextofsolvingmathematical
5、problems在解决数学问题这个背景下编写的Thelistbecomesapplicabletoalltypesofproblems这个列表完全适用于各种类型的问题5AskQuestions...提出问题…tounderstandtheproblemWhatdoIknowabouttheproblem?对这个问题我了解多少?WhatistheinformationthatIhavetoprocessinorderthefindthesolution?要找到解决方案我必须处理哪些信息?Whatdoes
6、thesolutionlooklike?解决方案是什么样的?6AskQuestions...提出问题Whatsortofspecialcasesexist?存在什么特例?HowwillIrecognizethatIhavefoundthesolution?我如何知道已经找到了解决方案了?7如何解决它?第一步必须理解问题第二步找到信息和解决方案之间的联系。如果找不到直接的联系,则可能需要考虑辅助问题。最终,应该得到解决方案。第三步执行方案第四步分析得到的解决方案8LookforFamiliarThin
7、gs寻找熟悉的情况YoushouldneverreinventthewheelIncomputing,youseecertainproblemsagainandagainindifferentguises在计算领域中,你会看到某种问题不断地以不同的形式出现。Agoodprogrammerseesatask,orperhapspartofatask(asubtask),thathasbeensolvedbeforeandplugsinthesolution一个好的程序员看到以前解决的任务或者任务的
8、一部分时,会直接选用已有的解决方案。9DivideandConquer分治法Breakupalargeproblemintosmallerunitsthatwecanhandle把一个大的问题分解为一些小的能够处理的部分。AppliestheconceptofabstractionThedivide-and-conquerapproachcanbeappliedoverandoveragainuntileachsubtaskismanageable10A
此文档下载收益归作者所有