?? linelist.cpp
字號(hào):
//線性表的操作linelist.cpp
#include "linelist.h"
void List::init(List *L)
{L->elem=(ElemType *)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!L->elem) exit(OVERFLOW);
L->length=0;
L->listsize=LIST_INIT_SIZE;
}
int List::ListLength()
{return length;}
ElemType List::GetElem(int i,ElemType *e)
{*e=elem[i];return *e;}
bool List::ListInsert(int i,ElemType e)
{ ElemType *p,*q;
if (i<0||i>length) return false;
q=&elem[i];
for(p=&elem[length];p>=q;--p)
*(p+1)=*p;
*q=e;
++length;
return true;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -