欢迎来到得力文库 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
得力文库 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    大学计算机基础大学计算机基础 (38).ppt

    • 资源ID:84315325       资源大小:2.10MB        全文页数:15页
    • 资源格式: PPT        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    大学计算机基础大学计算机基础 (38).ppt

    Typical algorithm III:divide-and-conquer and backtrackingDivide-and-conquerThe basic idea of divide-and-conque is to divide a problem with scale of n into several smaller subproblems which are similar to the original problem,then solve these subproblems respectively,finally combine the results of each subproblem to get the solution of the whole problem.The divided subproblem is usually similar to the original problem,so the divide-and-conquer strategy can be used recursively to solve it.Example:find the position of integer x in an ascending order of N integers R n.Analysis:the integer sequence to be searched has been sorted in ascending order,using the method of binsearch.The basic idea is:the ordered data to be searched is divided into two subsets by the intermediate element,one of which is RL,the value of the element is less than or equal to the intermediate element,and the other is RH,the value of the element is more than or equal to the intermediate element.If the value of the intermediate element is equal to the given value x,the search is successful;if the value of the intermediate element is more than the given value x,do binsearch in the subset RL;otherwise,if the value of the intermediate element is less than the given value x,do binsearch in the subset RH.startinput digit groupoutputendQuestionWhat other questions are suitable for solving using divide-and-conquer?BacktrackingBacktracking is also called cut-and-try method.Its basic idea is:in the process of solving some problems,first select a possible situation to explore.When it is found that the tentative operations are not the best choice,it needs to go back a step(backtracking),and choose again to continue the tentative until the solution of the problem is found or the problem is proved to be unsolved.Analysis:place n queens on the n n chessboard,so that no one queen can directly capture other queens,that is,any two Queens can not be in the same row,the same column or the same diagonal.Example:using backtracking to solve the n queen problem.(1)First,check from the first place.If it cant be placed,then check the second position of the row.Check in turn until a place where a queen can be placed is found in the row.Then save the current status and go to the next row to repeat the retrieval of the above method.Natural language description of backtracking algorithm:assuming the current state of a row,check whether all positions of the row can put a queen.There are two retrieval states:(2)If no queen can be placed in all positions of the row after checking,it means that the position of the queen in the previous row cannot make all queens positionp proper,so it is necessary to go back to the previous row and recheck the position behind the Queens position.Backtracking Taking the four queens as an example,we can build a solution space tree,by exploring the solution space tree,we can get the possible solution of the four queens problem.Solution space treeSolution space treeQuestionWhat other typical cases?MazeDepth-First-Search of Graphs 0-1 Backpack

    注意事项

    本文(大学计算机基础大学计算机基础 (38).ppt)为本站会员(刘静)主动上传,得力文库 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知得力文库 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于得利文库 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

    © 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

    黑龙江省互联网违法和不良信息举报
    举报电话:0468-3380021 邮箱:hgswwxb@163.com  

    收起
    展开