Files
2022-WangDao-CS-DS-Notes/1.1线性表.md
2022-03-29 10:41:36 +08:00

44 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 线性表 —— Linear List
![线性表](https://github.com/oxyanyano/2022-WangDao-CS-DS-Notes/blob/main/images/1.png)
### 一、线性表的定义:
`线性表`是n个具有相同特性的数据元素的有限序列。
### 二、线性表的基本操作
`注`:参数代“&”表示:方法运行完后,对参数修改的结果要`“带回来”`
对数据的操作:创销,增删查改
```c
InitList(&L); //初始化表构造一个空的线性表L分配内存空间
DestoryList(&L); //销毁操作销毁线性表并释放线性表L所占用的内存空间
ListInsert(&L,i,e); //插入操作在表L中第i个位置上查入指定元素e
ListDelete(&L,i,&e); //删除操作删除表L中第i个位置的元素/*并用e反回删除元素的值*/
LocateElem(L,e); //按值查找操作
GetElem(L,i); //按位查找操作
//其它常用操作
Length(L); //求表长
Print(L); //输出操作
Empty(L); //判空操作
```
### 三、存储结构
`顺序存储``链式存储`
### 四、线性表分类
线性表的顺序存储:顺序表
线性表的链式存储:单双链表、循环链表
静态链表比较特殊:逻辑上离散,物理上连续