{
long int DNum
struct DataL * next
};
//插入函數,參數是左右節點的指針。返回當前節點指針。
struct DataL * InsertD(struct DataL * LeftD,struct DataL *RightD,long int D)
{
struct DataL * TempD
TempD=CreatD(RightD,D);
如果(LeftD!=0) LeftD->next = TempD
if(TempD = = 0)exit ex e(LeftD);
返回TempD
}
//創建新的節點函數
結構數據*創建(結構數據*頭,長整型)
{
struct DataL * temp
temp =(struct DataL *)malloc(sizeof(struct DataL));
temp->;DNum = D;
temp->;下壹個=頭;
返回溫度;
}
void Exit exe(struct datal * head)//退出函數。
{
struct DataL *temp1=Head,* temp2
while (temp1!=0)
{
temp 2 = temp 1;
temp 1 = temp 1->;接下來;
自由(temp 2);
}
總的來說是這樣的。我這裏有個相關的例子,沒編好,可以看看。