Определение
DATASTRUCTUREISACOLLECTIONOFDAELEMENTSWITHTRUCTURDCHARACRITISITIES.ItStudiestHelogicalstructureofdataandthephysical structureofData, aswellaStheInteractionbetweEnteentHemrelations, andesignTheCorrepsportingCalculationsforthistructuredefinition, andensurethattenewstructureStainseAfTerthesecalculationStillMaintainsTheArigUtuctureTuREType.Inshort, адатаструктурираколекция на DataElementShathatheAveOrmorEspicificeShipshipshiTheAtherh, thatis, acollectionofdateAlementSwitha „структура“."Структура" ReferStherotherelationshipThatexistsbetweendateAlements, което е разработено на интологична structureandstoragestureture.
TheLogicalStructUreAndphysicalStructureOfDataaretWoCloselyRelatedAspectSeptSofTheDataStructure.ThesamelogicalstructureCancorReponsyTodifferentStorageStructure.ThedesignofthealgorithmdependsonthelogicalstructureofTheData, и тереализацията на thealgorithmDependsonthespecifiedStoragesture.
TheresearchContentofDatastructureIsthebasisforConstructingComplexSoftWaresyStems, anditscoreTechnologyIsdeCompositionAndAbstraction.ThedataCanbedividedIntotheelevelsThroughdeComposition; thenthroughabstraction.По същия начин, bydividingTheProcessingRequirementsIntovaRiveFunctions, andThenByAbtractingAwaytheImplementationAtionaleDails, theОпределениеOfTheOperationisoBtained.TheCombinationoftheabovetwoaspectscantransformtheproblemintoadatastructure.Thisisaprocessfromconcrete (thatis, conticeProblems) toabstract (thatis, datastructure).След това, чрез създаване на по -нататък, на което се появяват, налагайте, нататък, thestoragestructureandtheimplementionationoperationarefurtherobtaled, soastoCompleteDeSigntask.Thisisaprocessfromabstraction (thatis, структура на данни) до бетон (thatis, бетонна реализация).
Изследователският обект
TheLogicalstructureofData
Препращане на refertothedatastructurethatreflectsTheLogicalRellationshipbetweEndataelements.THELOGICALELATIONSISSISBETWEENDAELEMENTS.Therelationship betweenbeforeAndafter, andhasnothingtodowiththeirstorageLocationIntecomputer.TheLogicalstructureNcludes:
1.Комплект: СЕСЕНСОТЕРСИРАНТИРАНЕ НА БЕЗПЛАТНО ДЕЙСТВИЕНТИНТИДЕДАТОТРУКТУРУКУПУВАНЕ НАПРАВЕТЕ FORMUTUALATIONSHIPOF „Принадлежащи tothesameset“;
2.Линейна структура: TheElementsInthedatastructurehave One-to-One връзка;
3.Структура на дърветата: TheElementsIntheDatastructurehave One-to-Many връзка;
4.Графична структура: TheElementsinthedatastructure е много към много отношения.
Thephysicalstructureofthedata
referstothestorageformofTheLogicalStructureOfTheDataInTheComputerStoragespace.
ThephysicalstructureofdataiSterepresentationOfTheDatatastructureInTheComputer (alsoknownaSteimage), който е включен в срока наначастия на DataelementsandtheinternalReprespensationofrelationships.Sincetherearemultiplespecificimplementationmethodssuchassequence, връзка, индекс, хеш и др.., адатаструктуриканбекспресирасонеорморестариджструктура.
In-MachineRepresentationOfDataEllements (MAPPINGMETHOD): AbitstringOfBinaryBits (BIT) ISUsuseStorepresentDaelementsements.ThiskindofbitstringisUsualCalleDanode.WhenAdateAlementConsistSofSeverAldataItems, thesub-bitstringCorrepondingtoeachadataiteMinTheBitStringIscalledAdatafield.Следователно, тенодеиственородно представяне (Orinternalimage) на theDataelement.
В MachineRepresentationOfrelationships (MAPPINGMETHOD): thein-machinerepresentationofrelationshipsbetweEndatelementscanbedividedIntosequentialImagesandnon-последователните хора, които са.TwoCommonlyusedStoragestructure: sequentialStoragestructureandchainstoragestructure.SequenceMappingUsestHereLativePositionOfTheEledementIntheMemoryTorePresentTheLogicalyshipshipshipsheledateAlements.NotpectialMappingUsespointersthatindicatestorageLocationsofelementSporepresentLogicalyshipssbetweEndateAlements.
DatastoragEstructure
ThestorageformofTheLogicalStructureOfDataInTheComputerStoragespaceiscalledthephysical structurefthedata (alsocalledthestoragestructure).Като цяло, телогически структуриофадатаструктурикантексекспред.CommonStorageStructuresIncludesequentyStorage, ChainStorage, IndexStorage, AndhashStorage.
Thecharacteristicofthesequentialstoragestructureofdatais:thelogicalrelationshipbetweenthedataelementsisexpressedbytherelativepositionoftheelementinthememory;thecharacteristicofnon-sequentialstorageis:thedataisexpressedbythepointerindicatingthestorageaddressoftheelementThelogicalrelationshipbetweenelements.
Класификация
Therearemanytypesofdataastructures.Като цяло, DataAreClassifiedSimplyCordingingTotheirLogicalStureSture, включително LinearErstructUreandnon-Linearearstructure.
Линейна структура
Просто, AlineArstructureMeansTheachNodeInTheTablehasalineArelationship.IfitisDescribedInthelanguageofTheDatatastructure, thelinearstructureshouldincludethefollowingpoints:
1.Thelinearstructureisanon-demptySet.
2.Thelinearstructurehasoneandonlyonestartnodeandoneendnode.
3.AllnodesofTheLineArstructureHaveAtostOnEdirectPredeSernodeAndonedirectsucessornode.
Lineartablesaretypicallinearstructures, и закъснения, опашки и stringsarealllinearnearstructure.
Нелинеарна структура
Просто, анонейноструктуриране на анолинейното структуриране отtherearemultiplecorreponsencesbetweeneecnodeInTheTable.IfdescribedInthelanguageofdataastructure, thenOnlineARSTRUCTURESSHOUDNCLUDETHEFOLLOWINGINGS:
1.ThenOnlineARSTRUCTUREISANON-DEMPTYSET.
2.Анодофанонониарниструктурирамайхавемултипедиректни предмета енсионес и се намира имълипедирективсучесторноди.
InpracticalApplications, DataStructureSuchasArrays, обобщени стойности, третиране и graphstructureAreallnon-lineareneArstructure.
Често използвани датаструктури
По време на разработката на Compusterscience, DatastructureshavealSovolved.Често използвани dadatastructuresInprogramdesignIncludetheflowing.
Масив (масив)
ArrayisAnaggregatedatatype, който е AsacollectionofseverAlvariablesofTheSameTypeyRganizedTogetherinAnderlyManner.ArrayCanBesaidToBeTheMostBasicDatastructure, която е кореспонсираща програманглагиране.Anarraycanbedecomposedintomultiplearraylements.Според TetTheTypesOfDataelements, ThearrayCanbedividedIndeIntegegerArrays, характеристики, плаващи-точки, указатели и структуриране.ArrayscanalsobeexpressedInone-размерен, двуизмерен и и multi-измерени форми.
Стека (стек)
Stackisaspeciallineartable.Itcanonlyinsertanddeletedatanodesononefixedendofatable.ThestackstoresdataAccordingTothelast-infirst-outprinciple, thatis, theDataSertedfirstwillbepushedtothebottomofTheStack и theDataNesertedlastwillbeatTheTopOfTheStack.WhenreadingData, ItisreadoutoneByOneFromTheTopOfTHESTACK.ThestackiSoftenusedforon-siteprotectionofimportantantainassemblylanguageprograms.Whentheriisnodatainthestack, itiscalleDanEmptyStack.
Опашка
Thequeeissimilartothestack, anditisalsoaspeciallineartable.Threkethestack, thequueonlyallowsensertOperationsononeendofTheAbleAndDeleteOperationsontheotherend.Като цяло, theendThatPerformsTheInsertionPerationIscalledTheTailefThequeue, и нататък, в който се появяват орех, в които е.WhenthereArenoElementsInThequeue, ItiscalleDanEmptyОпашка.
LinkedList
LinkedListisAdatastructureInhichDataElementRestoredArcordingToachainedStoragestructure.Thisstoragestureisphysicallynon-непрекъснато.ThelinkedListisComposedOfaseriesOfDataNodes, andeachdatanodeIncludestWopArts: DataFieldandPointerfield.Сред темата, thepointerfieldholdstheaddresswherethenextelementinthedatastructureisstored.TheLogicalOrderOfTheDataElEmentsInTheLinkedListStureSrealized ByTheLinkOrderOfThePointersInthelinkedList.
Дърво
ДървоisatypicalNonlineArstructure, Whoisafinitesetkincludingtwonodes.InTheTreEstructure, unisonyandnyonerootnode, което hasnopredecessornodes.AllothernodesinTheTreEstructureHaveEnandOnlyOnePredEcessornode, и тереканбетвосуксесоноди, m≥0.
Графика
Графикаisanothernon-Lineardatastructure.Inthegraphstructure, DataNodesAreGenerallyCalledVertices, andedgesareorderedpairsofvertices.IfTheReisAnEdgeBetWeentWovertices, itmeansthatthetwoverticeShaveAnadjacentRelationship.
Грамада
ГрамадаisaspecialДърво-образна диафрагенерация и и theheapsgenerallallydiscussedarebinaryГрамадаs.Thecharacteristicoftheheapisthatthevalueoftherootnodeishesmallestorthelargestamongallnodes, и theTwosubtreeseftherootnodeareaheapstructure.
Hashtable (хеш)
Thehashtableisderived от хеш функция (хеш функция).TheideaiShatifThereisARecordWithTheKeyWordEqualTotInthEstructure, thenItmustHereCordCanBefoundInthestOrageLocationOff (t), sothatTheCheCeDrecordCanbedIrectlyobtainseTitOutacparisonOperation.
Често използвани алгоритми
TheContentOfDatastructurerEsearch: howtoorganizethedataAcdingingToAcerenceLogicAlyStructure и andchoosetheappropriateStorageRepresentationmethodtostorethedataorganizedInthelogicalstructureTotheComputer'smemory.ThepursposeofalgorithmresearchistoprocessdataMoreEffectiveAndImproveTheEfticationOfDataOperation.TheoperationofdataisdefineSonthelogicalstructurefthedata, нотспецифична реализация на theOperationMustBecariedOnthestorageStructure.Като цяло, thereareseveralCommonlyusedOporations:
(1) Търсене.Извличане на продуктите, които нацерехатмеетайсторциратовите кондициониращи сентетаструктури.Като цяло, giventHevalueofacerinefield, findTheNoDewithTheValueOfThefield.
(2) Вмъкване.Addnewnodestothedatatastructure.
(3) Изтриване.Премахване.
(4) Актуализация.Changethevalueofoneormorefieldsofthespecifiednode.
(5) Сортиране.Пренасочване на пренасочване.Например, увеличение или намаляване.