资源描述:
《算法谜题(算法谜题)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、AlgorithmicPuzzlesThispageintentionallyleftblankALGORITHMICPUZZLESAnanyLevitinandMariaLevitin33OxfordUniversityPress,Inc.,publishesworksthatfurtherOxfordUniversity’sobjectiveofexcellenceinresearch,scholarship,andeducation.OxfordNewYorkAucklandCapeTownDaresSalaamHongKongKarachiKualaLumpur
2、MadridMelbourneMexicoCityNairobiNewDelhiShanghaiTaipeiTorontoWithofficesinArgentinaAustriaBrazilChileCzechRepublicFranceGreeceGuatemalaHungaryItalyJapanPolandPortugalSingaporeSouthKoreaSwitzerlandThailandTurkeyUkraineVietnamCopyright©2011byOxfordUniversityPressPublishedbyOxfordUniversityP
3、ress,Inc.198MadisonAvenue,NewYork,NewYork10016www.oup.comOxfordisaregisteredtrademarkofOxfordUniversityPressAllrightsreserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,inanyformorbyanymeans,electronic,mechanical,photocopying,recording,orotherwise,witho
4、utthepriorpermissionofOxfordUniversityPress.LibraryofCongressCataloging-in-PublicationDataLevitin,Anany.Algorithmicpuzzles/AnanyLevitin,MariaLevitin.p.cm.Includesbibliographicalreferencesandindex.ISBN978-0-19-974044-4(pbk.)1.Mathematicalrecreations.2.Algorithms.I.Levitin,Maria.II.Title.Q
5、A95.L4752011793.74—dc222010052043987654321PrintedintheUnitedStatesofAmericaonacid-freepaperToMaxwithloveThispageintentionallyleftblankContentsPrefaceixAcknowledgmentsxiiiListofPuzzlesxvTutorialPuzzlesxvMainSectionPuzzlesxviTheEpigraphPuzzle:Whosaidwhat?xxi1.Tutorials3GeneralStrategiesfor
6、AlgorithmDesign3AnalysisTechniques222.Puzzles32EasierPuzzles(#1to#50)32PuzzlesofMediumDifficulty(#51to#110)45HarderPuzzles(#111to#150)603.Hints724.Solutions82References241DesignStrategyandAnalysisIndex247IndexofTermsandNames254ThispageintentionallyleftblankPrefaceinQuestionsandAnswersWHAT
7、ISTHISBOOKABOUT?Thisbookisacollectionofalgorithmicpuzzles—puzzlesthatinvolve,explicitlyorimplicitly,clearlydefinedproceduresforsolvingproblems.Itisauniquecollectionofsuchpuzzles.Thebookincludessomeoldclassics,whichhavebecomeapartofmathematicsandcomputersciencefolklore.Ital