问题 问答题

设带表头结点的双向链表的定义为
typedef int ElemType;
typedef struct dnode∥双向链表结点定义
ElemType data;∥数据
struct dnode*lLink,*rLink;∥结点前驱与后继指针
)DblNode;
typedef DblNode*DblList;∥双向链表
试设计一个算法,改造一个带表头结点的双向链表,所有结点的原有次序保持在各个结点的右链域rLink中,并利用左链域lLink把所有结点按照其值从小到大的顺序连接起来。

答案

参考答案:void sort(DblNode*L)
{
DblNode*S=L—>rlink;∥指针s指向待插入结点,初始时指向第一个结点
while(S!一NULL)∥处理所有结点
{
pre=L;
p=L—>lLink;∥指针P指向待比较的结点,pre是P的前驱指针
while(p!—NULL&&s—>data<p—>data)
∥循1Link链寻找结点*S的插入位置
{
pre=P;
p=p—>lLink;
}
pre—>lLink=S;
s—>ILink=p;
s—s—>rLink;∥结点*s在lLink方向插入到*pre与*p之间
}
}

单项选择题
单项选择题

The Supreme Court will hear arguments about the use of public money for the private schooling of children with special needs. It’s interesting to note what’s not at issue: namely, that when a public school system is unable to provide an appropriate education, it is obligated to pay the costs of private school. Too bad poor children don’t have that unshakable right; if they did, there would be no controversy about the District program that gives vouchers to low-income children to attend private schools.

The case to be heard by the court hinges on whether parents have to enroll a child with special needs in public school before the child can attend private school at public expense. Special-education advocates say students shouldn’t have to waste time before being placed in a setting that best suits their needs, while school boards worry about a ruling that could amount to an unfettered fight to private schooling at public expense. What strikes us about the emotionally charged debate is the acceptance by both sides that sometimes it is appropriate to use public money to pay for a child to go to a private school. So, why all the arguments about the approximately$14 million for a federally funded program that lets 1,700 D. C. students attend private schools instead of failing public schools

To hear critics of the D. C. Opportunity Scholarship Program tell it, the use of public money for private schooling is as unprecedented as it is undesirable. In addition to the billions of dollars spent annually on private school tuitions for students with disabilities, private schools get public money for books, technology and teacher training. As long as the money is seen as benefiting the child, it is considered a proper, even desirable, use of public dollars.

Don’t get us wrong. We’re not arguing for the unilateral right of parents to enroll their sons and daughters in any school they wish with the taxpayers picking up the bill. Abuse of special-education policies has contributed to increased costs that threaten to take needed money from general public education funds. Safeguards are needed. Public schools should be pressed to do a better job for students with disabilities and students without. But there are schools in Washington where statistics show that failure is almost guaranteed. If a school system can’t educate a child—whether because of acute special needs or its own historical failings—why should that child not have options for a " free appropriate public education "

What does the word " unfettered " (Line 4, Para. 2)mean()

A. Unlimited

B. Extreme

C. Unwanted

D. Ultimate