问题 多项选择题

有两个单链表La和Lb,La中有m个元素,Lb中的元素个数为n。已知两个链表均为递增的单向链表。现想将两个链表归并成一个递增的单向链表,且希望利用原来的结点空间,请回答下列问题:

写出算法的实现函数;

答案

参考答案:算法的实现如下:
链表结点定义为:
struct node{
int value;
struct node * Next;
};
struct node * merge( struct node *a, struct node *b){
struct node *p;
struct node *q;
struct node *t;
if(a->value<=b->value){ //比较当前指针所指值的大小
p=a;
q=b;
} else{
p=b;
q=a;
}
t=p;
while(q){ //如果b链表先结束,那么将a链表剩余结点全部合并到新链表
if(p->Next==NULL){
p->Next=q;
break;
}
if(q->value<p->Next->value){
struct node * k=q->Next;
q->Next=p->Next;
p=p->Next;
q=k;
continue;
}
p=p->Next;
}
return t:
}

阅读理解

第二节:信息匹配:(共5小题,每题2分,满分10分)

阅读下列应用文及相关信息,并按照要求匹配信息。请在答题卡上将对应题号的相应选项字母涂黑。

首先,请阅读下列部门介绍。

Student Service Centre

The staff members are available to consult on career choice and applications for higher education.

Room Number:113

Tel: 8072 9771

Accommodation office

Mrs. J Marble is available each afternoon from 1:30 to 4:30 pm to assist students with problems relating to housing.

Room Number: 114

Tel: 8072 9772

Medical Room

Mrs. J Wright, the college nurse, is available each morning from 9:30 to 12:00 am. The college doctor is in attendance on Wednesday morning.

Room Number: 115

Tel: 8072 9773

Sports Office

Mrs. B Marie can provide information about sporting and keep-fit activities from 5:00 to 6:00 pm in the afternoon.

Room Number: 207

Tel: 8072 9774

Food Service

Mr. G Nunn is the manager and will do his best to help if you require a special diet on condition that you have already paid the tuition.

Room Number: 222

Tel: 8072 9775

Self Access Language Learning Centre

Students can attend a drop-in basis from 9:00 to 4:15 pm to improve your ability of listening and speaking.

Room Number: 203

Tel: 8072 9776

请阅读以下相关学生的信息,然后匹配他/她拟联系的部门:

56.   Tom is a freshman. He is too busy to take exercise and becomes too fat. He needs to take some action not to be so fat.

57.   Jim is to finish his study in college. He is considering whether to go to work or go on further study. He needs some help about it.

58.   Lily is going to finish her study in college and has an interview for a job in an

export company of which the manager told him to improve his expression in English.

59.   Li Lei can eat as much as he can, but he feels exhausted all the time. He doesn’t know why. He needs some help.

60.   Lucy has been in the college for two months when she suddenly falls ill. The doctor asks her only to have some liquid food. She needs some help from a particular department.

单项选择题