?? linelist.h
字號(hào):
//線性表的類(lèi)定義linelist.h
#ifndef LLIST
#define LLIST
#include<stdlib.h>
#define OVERFLOW -1
#define LIST_INIT_SIZE 30
#define LISTINCREMENT 10
typedef char ElemType;
//線性表的動(dòng)態(tài)分配順序存儲(chǔ)結(jié)構(gòu)
class List{
private:
ElemType *elem;//存儲(chǔ)空間基址
int length; //當(dāng)前長(zhǎng)度
int listsize;
//當(dāng)前分配的存儲(chǔ)容量以一數(shù)據(jù)元素存儲(chǔ)長(zhǎng)度為單位
public:
//無(wú)參構(gòu)造函數(shù)
List(){}
//初始化順序表
List(List *);
//刪除順序表
void DestroyList(List &L) {free(&L);}
//將順序表置為空表
void ClearList() {length=0;}
//判斷順序表是否為空表
bool ListEmpty()
{if(length==0) return true;
else return false;}
//判斷順序表是否為滿
bool ListFull()
{return length==listsize;}
//返回順序表的長(zhǎng)度
int ListLength();
// 獲取順序表中第i 個(gè)元素
ElemType GetElem(int,ElemType *);
//順序表的插入算法
bool ListInsert(int,ElemType);
};
#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -