《算法导论CLRS》英文版第三版.pdf
《算法导论CLRS》英文版第三版.pdf
上传者:
kssie
2011-09-06
评分
0
0
0
0
0
暂无简介
简介
举报
简介:本文档为《《算法导论CLRS》英文版第三版pdf》,可适用于IT/计算机领域,主题内容包含ALGORITHMSINTRODUCTIONTOTHIRDEDITIONTHOMASHCHARLESERONALDLCLIFFORDSTEINRIV符等。
ALGORITHMSINTRODUCTIONTOTHIRDEDITIONTHOMASHCHARLESERONALDLCLIFFORDSTEINRIVESTLEISERSONCORMENIntroductiontoAlgorithmsThirdEditionThomasHCormenCharlesELeisersonRonaldLRivestCliffordSteinIntroductiontoAlgorithmsThirdEditionTheMITPressCambridge,MassachusettsLondon,EnglandcMassachusettsInstituteofTechnologyAllrightsreservedNopartofthisbookmaybereproducedinanyformorbyanyelectronicormechanicalmeans(includingphotocopying,recording,orinformationstorageandretrieval)withoutpermissioninwritingfromthepublisherForinformationaboutspecialquantitydiscounts,pleaseemailspecialsalesmitpressmiteduThisbookwassetinTimesRomanandMathtimeProbytheauthorsPrintedandboundintheUnitedStatesofAmericaLibraryofCongressCataloginginPublicationDataIntroductiontoalgorithmsThomasHCormenetalrdedpcmIncludesbibliographicalreferencesandindexISBN(hardcover:alkpaper)ISBN(pbk:alkpaper)ComputerprogrammingComputeralgorithmsICormen,ThomasHQAIdcContentsPrefacexiiiIFoundationsIntroductionTheRoleofAlgorithmsinComputingAlgorithmsAlgorithmsasatechnologyGettingStartedInsertionsortAnalyzingalgorithmsDesigningalgorithmsGrowthofFunctionsAsymptoticnotationStandardnotationsandcommonfunctionsDivideandConquerThemaximumsubarrayproblemStrassen’salgorithmformatrixmultiplicationThesubstitutionmethodforsolvingrecurrencesTherecursiontreemethodforsolvingrecurrencesThemastermethodforsolvingrecurrencesProofofthemastertheoremProbabilisticAnalysisandRandomizedAlgorithmsThehiringproblemIndicatorrandomvariablesRandomizedalgorithmsProbabilisticanalysisandfurtherusesofindicatorrandomvariablesviContentsIISortingandOrderStatisticsIntroductionHeapsortHeapsMaintainingtheheappropertyBuildingaheapTheheapsortalgorithmPriorityqueuesQuicksortDescriptionofquicksortPerformanceofquicksortArandomizedversionofquicksortAnalysisofquicksortSortinginLinearTimeLowerboundsforsortingCountingsortRadixsortBucketsortMediansandOrderStatisticsMinimumandmaximumSelectioninexpectedlineartimeSelectioninworstcaselineartimeIIIDataStructuresIntroductionElementaryDataStructuresStacksandqueuesLinkedlistsImplementingpointersandobjectsRepresentingrootedtreesHashTablesDirectaddresstablesHashtablesHashfunctionsOpenaddressingPerfecthashingContentsviiBinarySearchTreesWhatisabinarysearchtreeQueryingabinarysearchtreeInsertionanddeletionRandomlybuiltbinarysearchtreesRedBlackTreesPropertiesofredblacktreesRotationsInsertionDeletionAugmentingDataStructuresDynamicorderstatisticsHowtoaugmentadatastructureIntervaltreesIVAdvancedDesignandAnalysisTechniquesIntroductionDynamicProgrammingRodcuttingMatrixchainmultiplicationElementsofdynamicprogrammingLongestcommonsubsequenceOptimalbinarysearchtreesGreedyAlgorithmsAnactivityselectionproblemElementsofthegreedystrategyHuffmancodesMatroidsandgreedymethodsAtaskschedulingproblemasamatroidAmortizedAnalysisAggregateanalysisTheaccountingmethodThepotentialmethodDynamictablesviiiContentsVAdvancedDataStructuresIntroductionBTreesDefinitionofBtreesBasicoperationsonBtreesDeletingakeyfromaBtreeFibonacciHeapsStructureofFibonacciheapsMergeableheapoperationsDecreasingakeyanddeletinganodeBoundingthemaximumdegreevanEmdeBoasTreesPreliminaryapproachesArecursivestructureThevanEmdeBoastreeDataStructuresforDisjointSetsDisjointsetoperationsLinkedlistrepresentationofdisjointsetsDisjointsetforestsAnalysisofunionbyrankwithpathcompressionVIGraphAlgorithmsIntroductionElementaryGraphAlgorithmsRepresentationsofgraphsBreadthfirstsearchDepthfirstsearchTopologicalsortStronglyconnectedcomponentsMinimumSpanningTreesGrowingaminimumspanningtreeThealgorithmsofKruskalandPrimContentsixSingleSourceShortestPathsTheBellmanFordalgorithmSinglesourceshortestpathsindirectedacyclicgraphsDijkstra’salgorithmDifferenceconstraintsandshortestpathsProofsofshortestpathspropertiesAllPairsShortestPathsShortestpathsandmatrixmultiplicationTheFloydWarshallalgorithmJohnson’salgorithmforsparsegraphsMaximumFlowFlownetworksTheFordFulkersonmethodMaximumbipartitematchingPushrelabelalgorithmsTherelabeltofrontalgorithmVIISelectedTopicsIntroductionMultithreadedAlgorithmsThebasicsofdynamicmultithreadingMultithreadedmatrixmultiplicationMultithreadedmergesortMatrixOperationsSolvingsystemsoflinearequationsInvertingmatricesSymmetricpositivedefinitematricesandleastsquaresapproximationLinearProgrammingStandardandslackformsFormulatingproblemsaslinearprogramsThesimplexalgorithmDualityTheinitialbasicfeasiblesolutionxContentsPolynomialsandtheFFTRepresentingpolynomialsTheDFTandFFTEfficientFFTimplementationsNumberTheoreticAlgorithmsElementarynumbertheoreticnotionsGreatestcommondivisorModulararithmeticSolvingmodularlinearequationsTheChineseremaindertheoremPowersofanelementTheRSApublickeycryptosystemPrimalitytestingIntegerfactorizationStringMatchingThenaivestringmatchingalgorithmTheRabinKarpalgorithmStringmatchingwithfiniteautomataTheKnuthMorrisPrattalgorithmComputationalGeometryLinesegmentpropertiesDeterminingwhetheranypairofsegmentsintersectsFindingtheconvexhullFindingtheclosestpairofpointsNPCompletenessPolynomialtimePolynomialtimeverificationNPcompletenessandreducibilityNPcompletenessproofsNPcompleteproblemsApproximationAlgorithmsThevertexcoverproblemThetravelingsalesmanproblemThesetcoveringproblemRandomizationandlinearprogrammingThesubsetsumproblemContentsxiVIIIAppendix:MathematicalBackgroundIntroductionASummationsASummationformulasandpropertiesABoundingsummationsBSets,EtcBSetsBRelationsBFunctionsBGraphsBTreesCCountingandProbabilityCCountingCProbabilityCDiscreterandomvariablesCThegeometricandbinomialdistributionsCThetailsofthebinomialdistributionDMatricesDMatricesandmatrixoperationsDBasicmatrixpropertiesBibliographyIndexPrefaceBeforetherewerecomputers,therewerealgorithmsButnowthattherearecomputers,thereareevenmorealgorithms,andalgorithmslieattheheartofcomputingThisbookprovidesacomprehensiveintroductiontothemodernstudyofcomputeralgorithmsItpresentsmanyalgorithmsandcoverstheminconsiderabledepth,yetmakestheirdesignandanalysisaccessibletoalllevelsofreadersWehavetriedtokeepexplanationselementarywithoutsacrificingdepthofcoverageormathematicalrigorEachchapterpresentsanalgorithm,adesigntechnique,anapplicationarea,orarelatedtopicAlgorithmsaredescribedinEnglishandinapseudocodedesignedtobereadablebyanyonewhohasdonealittleprogrammingThebookcontainsfiguresmanywithmultiplepartsillustratinghowthealgorithmsworkSinceweemphasizeefficiencyasadesigncriterion,weincludecarefulanalysesoftherunningtimesofallouralgorithmsThetextisintendedprimarilyforuseinundergraduateorgraduatecoursesinalgorithmsordatastructuresBecauseitdiscussesengineeringissuesinalgorithmdesign,aswellasmathematicalaspects,itisequallywellsuitedforselfstudybytechnicalprofessionalsInthis,thethirdedition,wehaveonceagainupdatedtheentirebookThechangescoverabroadspectrum,includingnewchapters,revisedpseudocode,andamoreactivewritingstyleTotheteacherWehavedesignedthisbooktobebothversatileandcompleteYoushouldfinditusefulforavarietyofcourses,fromanundergraduatecourseindatastructuresupthroughagraduatecourseinalgorithmsBecausewehaveprovidedconsiderablymorematerialthancanfitinatypicalonetermcourse,youcanconsiderthisbooktobea“buffet”or“smorgasbord”fromwhichyoucanpickandchoosethematerialthatbestsupportsthecourseyouwishtoteachxivPrefaceYoushouldfinditeasytoorganizeyourcoursearoundjustthechaptersyouneedWehavemadechaptersrelativelyselfcontained,sothatyouneednotworryaboutanunexpectedandunnecessarydependenceofonechapteronanotherEachchapterpresentstheeasiermaterialfirstandthemoredifficultmateriallater,withsectionboundariesmarkingnaturalstoppingpointsInanundergraduatecourse,youmightuseonlytheearliersectionsfromachapterinagraduatecourse,youmightcovertheentirechapterWehaveincludedexercisesandproblemsEachsectionendswithexercises,andeachchapterendswithproblemsTheexercisesaregenerallyshortquestionsthattestbasicmasteryofthematerialSomearesimpleselfcheckthoughtexercises,whereasothersaremoresubstantialandaresuitableasassignedhomeworkTheproblemsaremoreelaboratecasestudiesthatoftenintroducenewmaterialtheyoftenconsistofseveralquestionsthatleadthestudentthroughthestepsrequiredtoarriveatasolutionDepartingfromourpracticeinpreviouseditionsofthisbook,wehavemadepubliclyavailablesolutionstosome,butbynomeansall,oftheproblemsandexercisesOurWebsite,http:mitpressmitedualgorithms,linkstothesesolutionsYouwillwanttocheckthissitetomakesurethatitdoesnotcontainthesolutiontoanexerciseorproblemthatyouplantoassignWeexpectthesetofsolutionsthatweposttogrowslowlyovertime,soyouwillneedtocheckiteachtimeyouteachthecourseWehavestarred()thesectionsandexercisesthataremoresuitableforgraduatestudentsthanforundergraduatesAstarredsectionisnotnecessarilymoredifficultthananunstarredone,butitmayrequireanunderstandingofmoreadvancedmathematicsLikewise,starredexercisesmayrequireanadvancedbackgroundormorethanaveragecreativityTothestudentWehopethatthistextbookprovidesyouwithanenjoyableintroductiontothefieldofalgorithmsWehaveattemptedtomakeeveryalgorithmaccessibleandinterestingTohelpyouwhenyouencounterunfamiliarordifficultalgorithms,wedescribeeachoneinastepbystepmannerWealsoprovidecarefulexplanationsofthemathematicsneededtounderstandtheanalysisofthealgorithmsIfyoualreadyhavesomefamiliaritywithatopic,youwillfindthechaptersorganizedsothatyoucanskimintroductorysectionsandproceedquicklytothemoreadvancedmaterialThisisalargebook,andyourclasswillprobablycoveronlyaportionofitsmaterialWehavetried,however,tomakethisabookthatwillbeusefultoyounowasacoursetextbookandalsolaterinyourcareerasamathematicaldeskreferenceoranengineeringhandbookPrefacexvWhataretheprerequisitesforreadingthisbookYoushouldhavesomeprogrammingexperienceInparticular,youshouldunderstandrecursiveproceduresandsimpledatastructuressuchasarraysandlinkedlistsYoushouldhavesomefacilitywithmathematicalproofs,andespeciallyproofsbymathematicalinductionAfewportionsofthebookrelyonsomeknowledgeofelementarycalculusBeyondthat,PartsIandVIIIofthisbookteachyouallthemathematicaltechniquesyouwillneedWehaveheard,loudandclear,thecalltosupplysolutionstoproblemsandexercisesOurWebsite,http:mitpressmitedualgorithms,linkstosolutionsforafewoftheproblemsandexercisesFeelfreetocheckyoursolutionsagainstoursWeask,however,thatyoudonotsendyoursolutionstousTotheprofessionalThewiderangeoftopicsinthisbookmakesitanexcellenthandbookonalgorithmsBecauseeachchapterisrelativelyselfcontained,youcanfocusinonthetopicsthatmostinterestyouMostofthealgorithmswediscusshavegreatpracticalutilityWethereforeaddressimplementationconcernsandotherengineeringissuesWeoftenprovidepracticalalternativestothefewalgorithmsthatareprimarilyoftheoreticalinterestIfyouwishtoimplementanyofthealgorithms,youshouldfindthetranslationofourpseudocodeintoyourfavoriteprogramminglanguagetobeafairlystraightforwardtaskWehavedesignedthepseudocodetopresenteachalgorithmclearlyandsuccinctlyConsequently,wedonotaddresserrorhandlingandothersoftwareengineeringissuesthatrequirespecificassumptionsaboutyourprogrammingenvironmentWeattempttopresenteachalgorithmsimplyanddirectlywithoutallowingtheidiosyncrasiesofaparticularprogramminglanguagetoobscureitsessenceWeunderstandthatifyouareusingthisbookoutsideofacourse,thenyoumightbeunabletocheckyoursolutionstoproblemsandexercisesagainstsolutionsprovidedbyaninstructorOurWebsite,http:mitpressmitedualgorithms,linkstosolutionsforsomeoftheproblemsandexercisessothatyoucancheckyourworkPleasedonotsendyoursolutionstousToourcolleaguesWehavesuppliedanextensivebibliographyandpointerstothecurrentliteratureEachchapterendswithasetofchapternotesthatgivehistoricaldetailsandreferencesThechapternotesdonotprovideacompletereferencetothewholefieldxviPrefaceofalgorithms,howeverThoughitmaybehardtobelieveforabookofthissize,spaceconstraintspreventedusfromincludingmanyinterestingalgorithmsDespitemyriadrequestsfromstudentsforsolutionstoproblemsandexercises,wehavechosenasamatterofpolicynottosupplyreferencesforproblemsandexercises,toremovethetemptationforstudentstolookupasolutionratherthantofinditthemselvesChangesforthethirdeditionWhathaschangedbetweenthesecondandthirdeditionsofthisbookThemagnitudeofthechangesisonaparwiththechangesbetweenthefirstandsecondeditionsAswesaidaboutthesecondeditionchanges,dependingonhowyoulookatit,thebookchangedeithernotmuchorquiteabitAquicklookatthetableofcontentsshowsthatmostofthesecondeditionchaptersandsectionsappearinthethirdeditionWeremovedtwochaptersandonesection,butwehaveaddedthreenewchaptersandtwonewsectionsapartfromthesenewchaptersWekeptthehybridorganizationfromthefirsttwoeditionsRatherthanorganizingchaptersbyonlyproblemdomainsoraccordingonlytotechniques,thisbookhaselementsofbothItcontainstechniquebasedchaptersondivideandconquer,dynamicprogramming,greedyalgorithms,amortizedanalysis,NPCompleteness,andapproximationalgorithmsButitalsohasentirepartsonsorting,ondatastructuresfordynamicsets,andonalgorithmsforgraphproblemsWefindthatalthoughyouneedtoknowhowtoapplytechniquesfordesigningandanalyzingalgorithms,problemsseldomannouncetoyouwhichtechniquesaremostamenabletosolvingthemHereisasummaryofthemostsignificantchangesforthethirdedition:WeaddednewchaptersonvanEmdeBoastreesandmultithreadedalgorithms,andwehavebrokenoutmaterialonmatrixbasicsintoitsownappendixchapterWerevisedthechapteronrecurrencestomorebroadlycoverthedivideandconquertechnique,anditsfirsttwosectionsapplydivideandconquertosolvetwoproblemsThesecondsectionofthischapterpresentsStrassen’salgorithmformatrixmultiplication,whichwehavemovedfromthechapteronmatrixoperationsWeremovedtwochaptersthatwererarelytaught:binomialheapsandsortingnetworksOnekeyideainthesortingnetworkschapter,theprinciple,appearsinthiseditionwithinProblemasthesortinglemmaforcompareexchangealgorithmsThetreatmentofFibonacciheapsnolongerreliesonbinomialheapsasaprecursorPrefacexviiWerevisedourtreatmentofdynamicprogrammingandgreedyalgorithmsDynamicprogrammingnowleadsoffwithamoreinterestingproblem,rodcutting,thantheassemblylineschedulingproblemfromthesecondeditionFurthermore,weemphasizememoizationabitmorethanwedidinthesecondedition,andweintroducethenotionofthesubproblemgraphasawaytounderstandtherunningtimeofadynamicprogrammingalgorithmInouropeningexampleofgreedyalgorithms,theactivityselectionproblem,wegettothegreedyalgorithmmoredirectlythanwedidinthesecondeditionThewaywedeleteanodefrombinarysearchtrees(whichincludesredblacktrees)nowguaranteesthatthenoderequestedfordeletionisthenodethatisactuallydeletedInthefirsttwoeditions,incertaincases,someothernodewouldbedeleted,withitscontentsmovingintothenodepassedtothedeletionprocedureWithournewwaytodeletenodes,ifothercomponentsofaprogrammaintainpointerstonodesinthetree,theywillnotmistakenlyendupwithstalepointerstonodesthathavebeendeletedThematerialonflownetworksnowbasesflowsentirelyonedgesThisapproachismoreintuitivethanthenetflowusedinthefirsttwoeditionsWiththematerialonmatrixbasicsandStrassen’salgorithmmovedtootherchapters,thechapteronmatrixoperationsissmallerthaninthesecondeditionWehavemodifiedourtreatmentoftheKnuthMorrisPrattstringmatchingalgorithmWecorrectedseveralerrorsMostoftheseerrorswerepostedonourWebsiteofsecondeditionerrata,butafewwerenotBasedonmanyrequests,wechangedthesyntax(asitwere)ofourpseudocodeWenowuse“D”toindicateassi