正在加载图片...
212线性表的抽象数据类型描述 ADT List 数据对象 D={a11≤i≤n,n≥0,a为 Elemtype类型 ElemType是自定义类型,本章中假设 ElemType为 Istring 数据关系: r={<a,a1+1-|aa+1∈D=1,…,n-1 基本运算 void create list( (stringl split):由spli数组中的元素建立存储结构。 string Displisto:将线性表中的所有元素构成一个字符串返回。 int ListLengtho:求线性表的长度 bool getelem(inti, restring e):求线性表中序号为的元素值e int Locate elem( string e):按元素值e查找其序号。 bool ListInsert(int i, stringe):插入数据元素e作为线性表的第个元素。 bool listDelete(int i; ref string e):在线性表中删除第个数据元素e。2.1.2 线性表的抽象数据类型描述 ADT List { 数据对象: D={ai | 1≤i≤n,n≥0,ai为ElemType类型} //ElemType是自定义类型,本章中假设ElemType为string 数据关系: r={<ai ,ai+1> | ai ,ai+1∈D,i=1,…,n-1} 基本运算: void CreateList(string[] split):由split数组中的元素建立存储结构。 string DispList():将线性表中的所有元素构成一个字符串返回。 int ListLength():求线性表的长度。 bool GetElem(int i,ref string e):求线性表中序号为i的元素值e int LocateElem(string e):按元素值e查找其序号。 bool ListInsert(int i,string e):插入数据元素e作为线性表的第i个元素。 bool ListDelete(int i,ref string e):在线性表中删除第i个数据元素e。 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有