问题 多项选择题

【说明】
当一元多项式

aixi中有许多系数为零时,可用一个单链表来存储,每个节点存储一个非零项的指数和对应系数。
为了便于进行运算,用带头节点的单链表存储,头节点中存储多项式中的非零项数,且各节点按指数递减顺序存储。例如:多项式8x5-2x2+7的存储结构为:


函数中使用的预定义符号如下:
#define EPSI le-6
struct Node( /*多项式中的一项*/
double c;/*系数*/
int e; /*指数*/
struct Node *next;
;
typedef struct/*多项式头节点*/
int n; /*多项式不为零的项数*/
struct Node *head;
POLY;
【函数】
void Del(POLY *C, struct Node *p)
/*若p是空指针则删除头节点,否则删除p节点的后继*/

struct Node *t;
/*C是空指针或C没有节点*/
if(C==NULL||C->head==NULL)return;
if( (1) )/*删除头节点*/
t=C->head;
C->head=t->next;
return;
/*if*/
t=p->next;
p->next=t->next;
;/*Del*/
void Insert(POLY *C, struct Node *pC)
/*将pC节点按指数降序插入到多项式C中*/
/*若C中存在pC对应的指数项,则将系数相加;若其结果为零,则删除该节点*/

struct Node *t, *tp;
/*pC为空指针或其系数近似为零*/
if(pC==NULL || fabs(pC->c) < EPSI)return;
if(C->head==NULL) /*若C为空, 作为头节点插入*/
C->head=pC;
pC->next=NULL;
C->n++;
return;
/*if*/
/*若pC的指数比头节点的还大, 插入到头节点之前*/
if(pC->e>C->head->e)
(2) ;
C->head=pC;
C->n++;
return;
/*if*/
(3) ;
t=C->head;
while(t!=NULL)
if(t->e>pC->e)
tp=t;
t=t->next;

else if(t->e==pC->e)/*C中已经存在该幂次项*/
t->c+=pC->c;/*系数相加*/
if(fabs(t->c)<EPSI)/*系数之和为零*/
(4) ;/*删除对应节点*/
C->n--;

(5) ;

else t=NULL;/*C中已经不存在该幂次项*/
/*while*/
if(t==NULL)/*适当位置插入*/
pC->next=tp->next;
tp->next=pC;
C->n++;
/*if*/
;/*Insert*/

答案

参考答案:(A) p==NULL
(B) pC->next=C->head->next
(C) tp=NULL
(D) Del(C, tp)
(E) break

解析:

[分析]: 根据注释,Del函数当p是空指针时,删除头节点,因此易知(1)空应填p==NULL。
(2)空是插入头节点的特殊情况,应填pC->next=C->head->next。
由注释可知空(4)是删除操作,需调用Del函数,进一步确定实参。此处需要删除节点t,结合Del函数的说明,实参p需要空指针(NULL)或t节点的前驱指针,由if(t->e>pC->e){tp =t;t=t->next;}可知,tp正是t节点的前驱指针,因此应填Del(C,tp)。由此也可以确定空(3),当需要删除头节点时,tp应是空指针,因此空(3)应填tp=NULL。
至于空(5),应填break。此时,节点p已正确处理完毕,应该结束while循环,而且必须终止,否则while循环结束后t值为NULL,将会错误地执行插入操作。

阅读理解

In the 19th century, there used to be a model of how to be a good person. There are all these torrents of passion flowing through you. Your job, as captain of your soul, is to erect dams to keep these passions in check. Your job is to just say no to laziness, lust, greed, drug use and the other sins.

  These days that model is out of fashion. You usually can’t change your behavior by simply resolving to do something. Knowing what to do is not the same as being able to do it. Your willpower is not like a dam that can block the torrent of self-indulgence. It's more like a muscle, which tires easily. Moreover, you're a social being. If everybody around you is overeating, you’ll probably do so, too.

  The 19th-century character model was based on an understanding of free will. Today, we know that free will is bounded. People can change their lives, but ordering change is not simple because many things, even within ourselves, are beyond our direct control.

  Much of our behavior, for example, is guided by unconscious habits. Researchers at Duke University calculated that more than 40 percent of the actions we take are governed by habit, not actual decisions. Researchers have also come to understand the structure of habits—cue, routine, reward.

  You can change your own personal habits. If you leave running shorts on the floor at night, that'll be a cue to go running in the morning. Don’t try to ignore your afternoon snack craving. Every time you feel the cue for a snack, insert another routine. Take a walk.

  Their research thus implies a different character model, which is supposed to manipulate the neuralnetworks inside.

  To be an effective person, under this model, you are supposed to coolly examine your own unconscious habits, and the habits of those under your care. You are supposed to devise strategies to alter the cues and routines. Every relationship becomes slightly manipulative, including your relationship with yourself. You're trying to arouse certain responses by implanting certain cues.

  This is a bit disturbing, because the important habitual neural networks are not formed by mere routine, nor can they be reversed by clever cues. They are burned in by emotion and strengthened by strong yearnings, like the yearnings for admiration and righteousness.

  If you think you can change your life in a clever way, the way an advertiser can get you to buy an air freshener, you’re probably wrong. As the Victorians understood, if you want to change your life, don’t just look for a clever cue. Commit to some larger global belief.

小题1:Which of the following is the first-to-none element in the 19th-century character model?

A.Action.

B.Capacity.

C.Resolution.

D.Enthusiasm.小题2:The 19th-century model supposedly does not work on the grounds that ________

A.one’s wished should be pondered before acting.

B.the comparison of free will to a dam is groundless.

C.it has been proved impractical and cannot hold true.

D.there were many other factors beyond one's control.小题3:The research at Duke University indicated that ________

A.One’s behavior is tough to change.

B.Habit has an unidentified structure.

C.Habit plays a vital role in one's behavior.

D.Both habit and will power are of significance.小题4:According to the new character model, personal behavior could be altered through

A.techniques to break old routines.

B.techniques to provide different physical cues.

C.cues to change all the former unconscious habits.

D.cues to manipulate the habitual neural responses.小题5:We can learn from the passage that the new character model ________

A.can generate changes in one's life like what advertisers do.

B.highlights the neural and psychological aspects of habit change.

C.has been identified a new method of changing behavior perfectly.

D.has an advantage over others in dealing with emotional aspects of behavior.

单项选择题