欢迎来到天天文库
浏览记录
ID:44251779
大小:879.50 KB
页数:42页
时间:2019-10-20
《Data Structures with C++ using STL 2E Chapter 1》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1MainIndexContentsStorageContainers-General-Vectors(3slides)-Lists-MapsADT’s(2slides)Classes-Declaration-Private/PublicSections(3slides)time24functionaddTime()Chapter1–IntroductiontoObjectTechnologyScopeResolutionOperatorRectangleClass(4slides)API-Constructor-Operations-randomNumb
2、erClass(2slides)GeneratingRandomNumbersStringFunctionsandOperations(6slides)SummarySlides(9slides)1StorageContainers(General)Airlinesandtelecommunicationcompaniesuseagridofnodesandinterconnectingedgestorepresentcitiesandroutersinanetwork.Containerssuchasvectors,listsormapsarestor
3、agestructuresthatprovidewaystoaccessdataandinsert/deleteitems.Example23MainIndexContents3StorageContainers(Vectors)Avectorhasalloftheniceindexingfeaturesofanarrayalongwiththeabilitytodynamicallygrowtomeetdemand.//outputelementsofvfor(i=0;i4、StorageContainers(Vectors)Avectorisa"super-array“,meaningallfamiliararrayalgorithmswork.Youalsohavethefreedomtotogroworshrinkit.5StorageContainers(Vectors)Vectorsallowfordirectaccesstotheirelementsthroughanindex,butarenotefficientstoragestructuresfor:insertionofitemsatarbitraryp5、ositionsinalist.deletionofitemsatarbitrarypositionsinalist.67MainIndexContents7StorageContainers(Lists)listcontainereachelementhasareferencethatidentifiesthenextiteminthelist.Addinganewiteminvolvesbreakingalinkinthechainandcreatingtwonewlinkstoconnecttheitem.8StorageContainers(M6、aps)mapsuseatreestructuretostoredata.Aisacontainerthatstoreselementsasnodesemanatingfromaroot.TREE9AsearchtreeholdingairbillnumbersThetreeholds8elements.Anysearchrequiresatmost3movementsalongapathfromtheroot.BACK1011MainIndexContentsAbstractDataTypesADTOperationDescriptionoperatio7、nName:Actionstatementthatspecifiestheinputparameters,thetypeofoperationontheelementsofthedatastructure,andtheoutputparameterPreconditions:Necessaryconditionsthatmustapplytotheinputparametersandthecurrentstateoftheobjecttoallowsuccessfulexecutionoftheoperation.Postconditions:Change8、sinthedataofthestructurecausedbyt
4、StorageContainers(Vectors)Avectorisa"super-array“,meaningallfamiliararrayalgorithmswork.Youalsohavethefreedomtotogroworshrinkit.5StorageContainers(Vectors)Vectorsallowfordirectaccesstotheirelementsthroughanindex,butarenotefficientstoragestructuresfor:insertionofitemsatarbitraryp
5、ositionsinalist.deletionofitemsatarbitrarypositionsinalist.67MainIndexContents7StorageContainers(Lists)listcontainereachelementhasareferencethatidentifiesthenextiteminthelist.Addinganewiteminvolvesbreakingalinkinthechainandcreatingtwonewlinkstoconnecttheitem.8StorageContainers(M
6、aps)mapsuseatreestructuretostoredata.Aisacontainerthatstoreselementsasnodesemanatingfromaroot.TREE9AsearchtreeholdingairbillnumbersThetreeholds8elements.Anysearchrequiresatmost3movementsalongapathfromtheroot.BACK1011MainIndexContentsAbstractDataTypesADTOperationDescriptionoperatio
7、nName:Actionstatementthatspecifiestheinputparameters,thetypeofoperationontheelementsofthedatastructure,andtheoutputparameterPreconditions:Necessaryconditionsthatmustapplytotheinputparametersandthecurrentstateoftheobjecttoallowsuccessfulexecutionoftheoperation.Postconditions:Change
8、sinthedataofthestructurecausedbyt
此文档下载收益归作者所有