数据结构课程教学设计-飞机订票系统设计与实?里面附有源代? - 百度文库 ر

,.

*p=hʹforѭƥflight_nump->flight_numҵƥĺڵúϢ

int place_check(flightnode *l,char *start_place,char *end_place)У庽ָ*p=hʹforѭѰƥstart_placestart_placeĽ㣬ҵƥĺúϢ

void check_all_flight(flightnode *l)У庽ָ*p=hʹforѭкϢ

a==1 ʼ ͻѡѯ ʽa aֵѡ a==3 a==2 flight_num_c check_all_fl place_chec heckвѯ ightвѯ kвѯ

flight_num_checkͼ

ʼ flightnode *p=h p!=NULL N ,.

3.5 ѯģ

롰5void passenger_check(passengerList *PList)ѡʹһֲѯʽвѯʾͻѯʽͻ롰1int ID_name_check(passengerList *PList,char *name,char *ID_num)ͻ֤ŶԶвѯʾͻ֤ţֱnameID_numУͻ롰2int order_num_check(passengerList *PList,int order_num)ŶԶвѯʾͻ붩ţorder_numУͻ롰3void check_all_passenger(passengerList *PList)ȫϢ

int ID_name_check(passengerList *PList,char *name,char *ID_num)Уͻָ*p= PList->head->nextʹforѭѰƥnameID_numĽ㣬ҵƥĶڵöϢ

,.

int order_num_check(passengerList *PList,int order_num)Уͻָ*p=PList->head->nextʹforѭѰƥorder_numĽ㣬ҵƥĶöϢ

void check_all_passenger(passengerList *PList)Уͻָ*p=PList->head->nextʹforѭжϢ

order_num_checkͼ ʼ

Y passengernode *p=PList->head->next p!=NULL Y p->order_num ==order_num N N a==1 ʼ ͻѡѯ ʽa aֵѡ a==3 a==2 order_num_ch name_ID_che check_all_pas ckвѯ sengerвѯ eckвѯ p=p->next ء0 Ϣء1 ,.

3.6 ޸ĺģ

롰6void modify_flight(flightnode *&h,passengerList *&PList)ԺϢ޸ġʾͻ޸ģʽͻ롰1void add_flight(flightnode *&h)ӺϢͻ롰2void delete_flight(flightnode *&h,passengerList *&PList)ɾָĺϢʾͻ뺽ţflight_numУͻ롰3ʾͻ뺽ţúŴڣʾû޸ĺɵִʱ䡣

void delete_flight(flightnode *&h,passengerList *&PList)У庽ָ*pr=h庽ָp=pr->nextͻָ*qr=PList->headͻָ*q=qr->nextʹwhileѭѰƥ亽ŵĺ㣬ҵִ

ʼ pr->next=p->next;free(p)ɾָĺϢʹwhileѭҵƥ亽ŵĶͻѡ޸ģ 㣬ִqr->next=q->next;free(q)ɾԸúඩƱĶϢûҵ

ʽa ƥĺ㣬ʾϢ aֵѡ a==1 a==3 뺽ţ flight_num a==2 delete_fli ghtɾ add_flight ӺϢ