问题 填空题

试题五
阅读以下说明和C语言函数,回答问题。
[说明]
已知包含头节点(不存储元素)的单链表的元素已经按照非递减方式排序,函数compress(NODE *head)的功能是去掉其中重复的元素,使得链表中的元素互不相同。
处理过程中,当元素重复出现时,保留元素第一次出现所在的节点。
图8-29(a)、(b)是经函数compress( )处理前后的链表结构示例图。


链表的节点类型定义如下:
typedef struct Node {
int data;
struct Node *next;
}NODE;
[C语言函数]
void compress(NODE *head)
{
NODE *ptr, *q;
ptr= (1) ; /*取得第一个元素节点的指针*/
while( (2) && ptr->next) {
q=ptr ->next;
while(q && (3) ){/*处理重复元素*/
(4) =q ->next;
free(q);
q=ptr->next;
}
(5) =ptr->next;
} /*end of while*/
} /*end of compress*/

答案

参考答案:ptr

阅读理解

阅读理解。

     Despite the high technology and investment (投资) in flood defences by the Environment Agency

(环保局), there is no way to stop all flooding--sooner or later nature will produce something that will

beat even the strongest defences.

     Warning people of tiffs danger is very important if we are to prevent the great loss of life seen

fifty-three years ago. Indeed if the Flood Waming System that currently exists had been around on that

cold, stormy night in January 1953, many lives would have been spared.

     The Environment Agency took over the role of flood warning in 1995 from the police who had to go

door to door or sound alarms to get the news out. The service is being constantly improved and a

combination of better technology and increased investment following the Easter Floods of 1998 has led to

the creation of Floodline and an automatic (自动) messaging system that can warn thousands of people in

very little time.

     Floodline 0845 988 1188 offers information and advice 24 hours a day and if warnings are in place,

callers can get information either from local updates or by using a quick dial code for their area. 

     The Flood Warning team in Kent has also sent letters to the people living close to the rivers or the sea

and invited them to join the AVM (automated voice messaging) system. Anyone choosing to take up this

free service will receive a recorded message directly to their home, business or pager telling them of tile

level of warning, giving them as much time as possible to carry out their flood plan and save items that

cannot be replaced if lost or damaged, such as photographs or children's favorite toys.

1. Choose the correct statements from tile following according to the passage.

a. Many people lost their lives in the flood in 1953.

b. The Flood Warning system was already in use in 1953.

e. Flood defences can stop all flooding.

d. The Environment Agency began to warn people of flood ill 1995.

e. Floodline was created after the Easter Floods of 1998.

A. a, b, c

B. b, c, d

C. a, c, e

D. a, d, e

2. What does the underlined word "pager" mean in tile passage? 

A. A boy employed to carry luggage in hotels.

B. A piece of equipment designed to receive and show messages.

C. A page of papers written to offer messages.

D. A person, invited to write pages of messages.

3. People can easily get information and advice about flood any time of the day from ______.

A. automatic messaging system

B. Floodline 0845 988 1188

C. the Flood Warning team in Kent

D. automated voice messaging system

4. The best title for this passage may probably be _______.

A. Enviromnent Agency

B. Technology In Flood Defences

C. Flood Warning System

D. Easter Floods

多项选择题