33,027
社区成员




typedef struct LNode {
ElemType data;
struct LNode* Next;
}LNode,*Linklist;
void Insert_LNode(Linklist L, int i, int x) {
Linklist p, q;
p = L->Next;
int j = 1;
while (p != NULL && j < i-1) {
p = p->Next;
j++;
}
if (p == NULL)
cout << "不存在" << endl;
else {
q = (Linklist)malloc(sizeof(LNode));
q->data = x;
q->Next = p->Next;
p->Next = q;
}
}