《数据结构》链表课件.ppt
《数据结构》;a1,;单链表结构;循环单链表结构;链表操作—搜索指定节点;循环链表操作—搜索指定节点;链表操作—指定节点前插入新节点,递增有序;
struct BILLdls_store(structBILL*S,structBILL*head)
{
struct BILL*p,*q;
if(!head){
head=S;
S-next=NULL;
return(S);
}
p=head;
q=p;
while(p){
if(p-keyS-key){
q=p;
p=p-next;
}
else{
if(p==head){
S-next=head;
head=S;
return(S);
}
q-next=S;
S-next=p;
return(head);
}
}
}
q-next=S;
S-next=NULL;
return(head);
};a1next;链表操作—删除指定节点;;head;
StructBILL*dls_store(structBILL*S,structBILL*head)
{
struct BILL*p,*q;
if(!head){
S-next=NULL;
S-pro=NULL;
return(S);
}
p=head;
q=p;
while(p){
if(p-keyS-key){
q=p;
p=p-next;
}
else{
if(p==head){
S-next=head;
S-pro=NULL;
p-pro=S;
return(S);
}
S-next=p;
S-pro=p-pro;
p-pro-next=S;
p-pro=S;
return(head);
}
};例1.5单链表复制(一);例1.5单链表复制(二);(X?Y)?X=Y;(NULL?ξi)=ξi;对称单链表结构;程序1.10对称表检索;矩阵的链式存储—十字链表;各行列头指针之间的关系;头指针数组;程序1.11辅助向量方式的十字链表节点插入函数;Hhead3;谢谢聆听!