数据结构讲义解读.pptx

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Chapter 02 Linear List 第二章 线性表 Prof. Qing Wang 2 Prof. Q. Wang 本章学习的线索 主要线索 重点 顺序存储表示 链式存储表示 难点 链式存储表示及实现 一元多项式的表示和运算 线性结构 ADT 顺序存储 表示及实现 链式存储 表示及实现 应用 一元多项式 3 Prof. Q. Wang Contents ADT of Linear list Sequential list Linked list Applications of Linked list Representation and operations of polynomials Conclusion 4 Prof. Q. Wang Characteristics of Linear structure 在数据元素的非空有限集中, (1)存在唯一的一个被称为“第一个”的数据元素 (2)存在唯一的一个被称为“最后一个”的数据元素 (3)除第一个之外,集合中的每个数据元素均只有一个前驱 (predecessor) (4)除最后一个之外,集合中的每个数据元素均只有一个后继 (successor) 5 Prof. Q. Wang 2.1 Linear List Linear list is also called list, which contains zero or n elements denoted as k0,, k1, …, kn-1 (n≥1). The number of element is called the length of the list. If the number is zero, the list is called “empty list”. The element is also called “item”. “线性表”简称为表,是零个或多个元素的有穷序列,通常可以表示成a0, a1, …, an-1 (n≥1)。表中所含元素的个数称为表的“长度”。长度为零的表称为“空表”。表中的元素又称“表目”。 6 Prof. Q. Wang Basic functions for Linear List 1. Initialization (创建空线性表); 2. Element insertion (在线性表中插入一个元素); 3. Element removal (在线性表中删除某个元素); 4. Find out the specific element (在线性表中查找某个特定元素); 5. Find out the successor of the specific element (在线性表中查找某个元素的后继元素); 6. Find out the predecessor of the specific element (在线性表中查找某个元素的前驱元素); 7. Judge the list is empty or not (判别一个线性表是否为空表) …… 7 Prof. Q. Wang ADT of Linear List ai, i=0,1,2,….n-1 ai , ai+1 Create IsEmpty Insert Remove Locate Traverse Next Previous 11 Prof. Q. Wang #include stdio.h #include alloc.h /* 符号常量 */ #define MAXNUM 100 /* 线性表空间大小 */ #define FALSE 0 #define TRUE 1 #define SPECIAL 2147483647 /* 与DataType 类型有关 32位机上的最大整数为231-1 */ #define PI 3.1415926 /* 常用结构 */ typedef int DataType; /* 定义数据类型为整型,也 可定义为其他类型 */ typedef int ElemType; /* 定义元素类型为整型,也 可定义为其他类型 */ typedef int KeyType; 12 Prof. Q. Wang Logical Physical forms Logical form: Linear List Physical form Sequential List (Array or Vector) Linked List a0 a1 a2 ... … ai ai+1 … an-2 an-1 a0 a1 a2 ai an-1 an-2 13 Prof. Q. Wang 2.2 Sequential List The sequen

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档