使用C++實現線性表的基本功能

使用C++實現線性表的基本功能,第1張

使用C++實現線性表的基本功能,第2張

#include
#include
#include
typedef int Elemtype;
//線性表的基本操作
void Initiallist(Elemtype *L);
int Isempty(Elemtype *L);
void ListTraverse(Elemtype *L);
int NextElem(Elemtype *L);
int PriorElem(Elemtype *L);
int LocateElem(Elemtype *L,Elemtype &e);
void GetElem(Elemtype *L);
void ListInsert(Elemtype *L);
void ListDelete(Elemtype *L);
void ClearList(Elemtype *L);
const int N=10;
Elemtype temp;//全侷變量!
void Initiallist(Elemtype *L)
{
for(int i=0;i*(L i)='#';
}
int Isempty(Elemtype *L)
{
if(*L=='#')
return 1;
else
return 0;
}
void ListTraverse(Elemtype *L)
{
static int k;
if(*(L)==35)
cout<<"The list is NULL!\n";
else
{
cout<<"The records of the list are:\n";
for(int i=0;i{
if((*(L i)>32768))
break;
else
cout<<*(L i)<<"";
}
k ;
}
}
int NextElem(Elemtype *L)
{
int index;
Elemtype e;
cout<<"Input the records for searching it's next Elem!\n";
cin>>e;
index=LocateElem(L,e);
if(*(L index 1)>32768)
cout<<"It has no next Elem!\n";
else
cout<}

位律師廻複

生活常識_百科知識_各類知識大全»使用C++實現線性表的基本功能

0條評論

    發表評論

    提供最優質的資源集郃

    立即查看了解詳情