文件名称:DivideAndConquer_Algo

  • 所属分类:
  • 数学计算/工程计算
  • 资源属性:
  • [C/C++] [源码]
  • 上传时间:
  • 2012-11-26
  • 文件大小:
  • 2kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • ze***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

1.  依照介面提示輸入yes 或 no

2.  每局結束後會印出你心中猜想的兩個數字並計算當次花費的回合數

3.  每局之間可連續



本程式採用的演算法策略為divide-and-conquer algorithm

1.  先將範圍盡量縮小,優先程序為先從小範圍求出一解

2.  盡量以2的次方數取範圍做分割尋找一個數字時,平均最佳的方法必是二分法。



因此如何以最小步數找到第一個解?若搜尋範我採用的方法,就是以最小步數先尋找到一個解,接著再用二分法找出剩餘的一個解。為了讓二分法能夠廣泛使用,我將所有問題的範圍基本上都是以4作為起始的小單位,也是第一個問題選擇5和16的原因。



圍後的回答是yes,那我將會不停的搜尋此範圍直到確定一個答案為止。因為若跳脫再去搜尋未知的區域,可能得到的答案會是no,最後可能會繞一圈又回來同樣的範圍。-1. In accordance with interface prompted yes or no

2. After the end of each set will be printed in your heart Guess two numbers and calculate the number of turns when the time spent

3. Continuous between each set



The program uses the algorithm strategy divide-and-conquer algorithm

1. First minimizing the area, the priority program for the first of a solution obtained from small areas

2. As far as possible in order to obtain a power of 2 range to split the number to find a number, the average will be the best way is dichotomy.



So what is the minimum number of steps to find the first solution? If the search scope My approach is to first find the minimum number of steps to a solution, then using the left to find a solution dichotomy. Dichotomy can be widely used to make, and I will all the problems are basically the scope of 4 as the starting small unit, is the first question the reasons for selection 5 and 16.



Around after the answer is yes, then I will keep the scope of the
(系统自动生成,下载前可以参看下载内容)

下载文件列表

DivideAndConquer_Algo.cpp

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org