- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Algorithmic Puzzles.ppt
Catching a Spy (Algorithmic Puzzles, #136) How to catch the spy? 0 1 2 3 4 -1 -2 -3 -4 Algorithmic Puzzles and Main CS Ideas Tower of Hanoi (édouard Lucas, 1883) There are n disks of different sizes and three pegs. Initially, all the disks are on the first peg in order of size, the largest on the bottom and the smallest on top. The objective is to transfer all the disks to another peg by a sequence of moves. Only one disk can be moved at a time, and it is forbidden to place a larger disk on top of a smaller one. Algorithmic Puzzles and Main CS Ideas All 9 general algorithm design strategies can be nicely illustrated by algorithmic puzzles, showing applicability of the strategies to problems outside traditional computing domainSee:A. Levitin, Introduction to the Design and Analysis of Algorithms, 3rd ed., 2011A. Levitin and M. Levitin, Algorithmic Puzzles, 2011A. Levitin and M.-A. Papalaskari, Proc. of SIGCSE’02 Algorithmic Puzzles and Main CS Ideas Insolvability of some problems and the idea of an invariant: a property that doesn’t change by any of the operations allowed in the problem Parity (e.g. 7 Bridges of K?nigsberg, the Fifteen Puzzle) Coloring (e.g. many tiling and chessboard tour problems) Algorithmic Puzzles and Main CS Ideas Algorithm efficiency False Coin Detection Find a lighter fake among n coins with a balance scale without any weights. Brute force: weigh coin pairs (1 vs. 1) Divide-by-half: divide into two halves (with 1 aside if n is odd) and compare their weights Divide into 3 about equal subsets is better than dividing into two Schweik’s Puzzle (Algorithmic Puzzles, #50) Note: The puzzle alludes to the hero of the novel The Good Soldier Schweik by the Czech writer Yaroslav Ha?ek (1883--1923). In this satirical novel, Schweik is depicted as a simple minded man who appears to be eager to execute orders but does it in a manner that, in fact, contradicts their intended goal. The good soldier Schweik had
您可能关注的文档
- 8. UNIT TESTING.ppt
- 8.1 功率放大电路的一般问题.ppt
- 8.1 民事法律关系客体概述.ppt
- 8.6 边值问题的数值解法.ppt
- 8A Unit 3A day outReading 1.ppt
- 9.1 杠杆.ppt
- 9.4.1几何上的应用.ppt
- 9.6 一个RMI的分布式应用的实例.ppt
- 90后离职率高达三成引热议高二九班 冯思瑶.ppt
- 98年台南市生态旅游种子教师研习营.ppt
- Algorithms for Nearest Neighbor Search.ppt
- ALTERNATIVE MODELS OF BANK PERFORMANCE.ppt
- American Business Culture.ppt
- American Housing Survey.ppt
- Amino Acids and Proteins.PPT
- Amplification.ppt
- An E-mail from Donna.ppt
- An English Song.ppt
- An English-Speaking World.ppt
- An inference engine for the semantic web.ppt
文档评论(0)