3、emp=p->number;p->number=small->number;small->number=temp;temp=p->pay;p->pay=small->pay;small->pay=temp;temp=p->time;p->time=small->time;small->time=temp;strcpy(cop,p->name);strcpy(p->name,small->name);strcpy(small->name,cop);strcpy(cop,p->department);strcpy(p->department,small->department);st
4、rcpy(small->department,cop);}}returnL;}LinkedListLinkedListInit()//線性鏈表初始化{LinkedListL;L=(LinkedList)malloc(sizeof(LNode));L->next=NULL;returnL;}voidLinkedListTraverse(LinkedListL)//單鏈表的遍歷{LinkedListp;p=L->next;printf("編號(hào)
5、姓名
6、部門
7、工時(shí)
8、時(shí)薪");while(p!=NULL){printf("%-3.0f%s%s%-3.0f%-3.0f",p->num
9、ber,p->name,p->department,p->time,p->pay);p=p->next;printf("");}}intLinkedListLength(LinkedListL)//求鏈表長(zhǎng)度{LinkedListp;intj;p=L->next;j=0;while(p!=NULL){j++;p=p->next;}returnj;}LinkedListLinkedListGet(LinkedListL,doublei)//查詢編號(hào)為i的雇員信息{LinkedListp;doublej=1,k;k=LinkedListLength(L);p=L->next;wh
10、ile(p!=0&&(j<=k)){if(p->number==i)returnp;elsep=p->next;j++;}return0;}LinkedListLinkedListGet_name(LinkedListL,charname[20])//查詢姓名為name的雇員信息{LinkedListp;doublej=1,k;k=LinkedListLength(L);p=L->next;while(p!=0&&(j<=k)){if(strcmp(p->name,name)==0)returnp;elsep=p->next;j++;}return0;}intLinkedList
11、Del(LinkedListL,doublenum)//雇員信息刪除{LinkedListpre,p;pre=L;p=L->next;while(p&&p->number!=num){pre=p;p=p->next;}if(p==NULL){printf("數(shù)據(jù)庫(kù)中沒(méi)有編號(hào)為%lf的雇員信息",num);return1;}pre->next=p->next;free(p);return0;}voidLinkedListInsert(LinkedListL,doublei,do