![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
在“while(!a)”中,其中“!a”与表达式()等价。
A.a= =0
B.a= =1
C.a!=1
D.a!=0
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
A.a= =0
B.a= =1
C.a!=1
D.a!=0
阅读下列算法,并回答问题:
(1)Q、Q1和Q2都是队列结构,设队列Q=(1,0,-5,2,-4,-6,9),其中1为队头元素,写出执行f31(&Q,&Q1,&Q2)之后队列Q、Q1和Q2的状态;
(2)简述算法f31的功能。
(注:InitQueue、EnQueue、DeQueue和QueueEmpty分别是队列初始化、入队、出队和判队空的操作)
void f31(Queue*Q,Queue*Q1,Queue*Q2){
int e;
InitQueue(Q1);
InitQueue(Q2);
while(!QueueEmpty(Q)){
e=DeQueue(Q);
if(e>=0)EnQueue(Q1,e);
else EnQueue(Q2,e);
}
}
pointer research_openhash(keytype K,openhash HP)
{ i=H(K); /*计算K的散列地址*/
p=HP[i]; /*i的同义词子表表头指针传给P*/
while(______)p=p—>next; /*未达到表尾且未找到时,继续扫描*/
______;
}
# define NULL 0
void Traversal(NODE。 head)
(NODE*p;
p= head;
/*p为工作指针。/
do
(printf("%d/n", p- >data);
〉while(p! = NULL);
函数中空格部分的选项为:
A. head= p- > next
B. p=head- >next
C. p=p- > next
D. head=head- > next
A.10
B.1
C.死循环,不能确定次数
D.6
A.for开始就定义范围
B.for所出的结果就在定义的范围内
C.while相当于列表逐级递增
D.while相当于列表逐级递减