ΪʲôgetÒªpÖ¸Õë³öÊÂʱL->next?
C:/Users/Administrator/Desktop/902397dda144ad3418b894bbd6a20cf431ad8582.jpgC:/Users/Administrator/Desktop/ac6eddc451da81cb94ec90f15466d01609243187.jpg
C:/Users/Administrator/Desktop/d31b0ef41bd5ad6e762174d687cb39dbb6fd3c35.jpg
ͬÑùÊÇÕÒÔªËØΪʲôgetÊÇp=L->next;¶øinsertºÍdelete¾ÍÖ±½Óp=L; ?
»°ËµÐÂÈ˱¨Á˸öµÀ http://d.hiphotos.baidu.com/zhidao/wh%3D600%2C800/sign=0a6ea2da217f9e2f7060150e2f00c51c/d31b0ef41bd5ad6e762174d687cb39dbb6fd3c35.jpghttp://f.hiphotos.baidu.com/zhidao/wh%3D600%2C800/sign=331821042e381f309e4c85af99316030/ac6eddc451da81cb94ec90f15466d01609243187.jpg
http://b.hiphotos.baidu.com/zhidao/wh%3D600%2C800/sign=c1303fd4ba3eb1354492bfbd962e84eb/902397dda144ad3418b894bbd6a20cf431ad8582.jpg ±ØÐëÈÎÎÒÐÐ ·¢±íÓÚ 2015-7-19 10:49
ͼ¹ÒÁË struct getElem(LinkList L, int i, ElemType *e){
int j;
LinkList p;
p - L->next;
j = 1;
while( p && j<i){
p = p-next;
++j;
}
if( !p || j>i){
return ERROR;
}
*e = p->data;
return OK;
}
struct ListInsert(LinkList *L, int i, ElemType e){
int j;
LinkList p,s;
p = *L;
j = 1;
while(p && j<i){
p = p->next;
j++;
}
if(!p || j>i){
return ERROR;
}
s = (LinkList)malloc(sizeof(Node));
s->data = e;
s->next = p->next;
p->next = s;
return OK;
}
ÎÒ¾ÍÕâÀï²»¶®,¶¼ÓвéÕÒÔªËصIJÙ×÷ÄÇΪʲôgetµÄpÖ¸ÕëÊÇÖ»ÏëL->next,¶øinsertÊÇÖ¸ÏòL£¿
Ò³:
[1]