- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
第二章-线性表1)--英文
2.1 List A finite set of n( ? 0) elements with the same characteristics (a0, a1, a2, a3, …….., an-1) 0= i n ai is element and n is the length Characteristics A finite set; Only one “the first” element; Only one “the last” element; Every Element except the first one has only one predecessor; Every Element except the last one has only one successor Preliminaries Empty – List contains no elements; Length – The number of elements stored; Head – The beginning of the list; Tail – The end of the list; Sorted list – The elements positioned in ascending order of value; Unsorted list – have no particular relationship between element values and positions. Operations on the ordered List Find the length of the list, n; Read the list from left to right ; Retrieve the i-th element,0= i =n-1; Store a new value into the i-th position, 0= i =n-1; Insert a new element at position i, 0= i =n-1 causing elements numbered i, i+….n to become numbered i+1, i+2, …., n+1; Delete the element at position i, 0= i =n-1 causing elements numbered i+1, …., n to become numbered i, i+1, …., n-1; 2.2 Array-Based List The most common way to represent an ordered list is by an array Representation of array-based list #define maxSize Typedef int T; Typedef struct { T data[maxSize]; int n; }SeqList; //静态表示 Typedef int T; Typedef struct { T *data; int maxSize, n; } SeqList; //动态表示 Implementation of some operations of list template class T LinearListT::LinearList ( int sz ) { //构造函数 if ( sz 0 ) { MaxSize = sz; last = -1; data = new T[MaxSize]; if (data==NULL) {cerr “Allocation Error” endl; exit(1);} } } template class T LinearListT::LinearList (LinearListTL) { //复制构造函数 maxSize = L.maxSize(); last =L.length()-1; data = new T[maxSize]; if (data==NULL) {cerr “Allocation Error” endl; exit(1);} for (i=1; i=last+1; i++) data[i-1] = L.getData(i); } template class T Line
您可能关注的文档
- 第二章 物流运方案设计.ppt
- 第二章 物态变 知识梳理复习.ppt
- 第二章 物质的学性质第一节 物质的性质与变化.ppt
- 第二章 物质的态.ppt
- 第二章 物流的展.ppt
- 第二章 物质的类和性质 第四讲.ppt
- 第二章 特殊三形复习(探索三角形可以被分割成两个等腰三角形的条件).ppt
- 第二章 物料需计划(MRP)3.ppt
- 第二章 犯罪与罪.ppt
- 第二章 特殊人的营养.ppt
- 2025国考重庆税务局申论大作文题库含答案.docx
- 2025国考厦门金融监管局申论归纳概括预测卷及答案.docx
- 2025国考重庆邮政管理局申论归纳概括模拟题及答案.docx
- 2025年国考重庆统计局无领导小组讨论应急管理专题考官视角详解.docx
- 2025国考青岛民航公安申论大作文题库含答案.docx
- 2025国考绥化市交通运输管理岗位行测高频考点及答案.docx
- 2025国考中央社院行测资料分析高频考点及答案.docx
- 2025国考云南铁路公安局申论公文写作高频考点及答案.docx
- 2025国考长治市纪检监察岗位申论高频考点及答案.docx
- 2025国考青岛邮政管理局行测言语理解与表达题库含答案.docx
最近下载
- 基于单片机的电子时钟设计.pdf VIP
- 中职英语高教版(2023修订版)基础模块1《Unit 1》同步教学课件.pptx VIP
- JB_T 3232-2017滚动轴承 万向节滚针轴承.pdf
- 中铜东南铜业有限公司电解提质增效项目报告书.docx VIP
- 中国成人呼吸系统疾病家庭氧疗指南(2024年).pptx
- 离心泵的结构知识课件.ppt VIP
- 螺栓拧紧力矩标准.docx VIP
- 大模型应用:从提示工程到AI智能体【363页PPT】.pptx VIP
- 人教版四年级下册道德与法治全册教学设计.doc VIP
- 海康威视 门禁 网络型多功能门禁控制主机 DS-K2600-G系列 使用说明.pdf
文档评论(0)