问题 单项选择题

假定已建立以下链表结构,且指针p和q已指向如图所示的结点:

则以下选项中可将q所指结点从链表中删除并释放该结点的语句组是()

A.(*P).next=(*q).next;free(P);

B.P=q->next;free(q);

C.P=q;free(q);

D.p->next=q->next;free(q);

答案

参考答案:D

解析:

要将结点b从链表中删除,应先将a的指针域指向b结点的下一个结点,即p->next=q->next,然后释放指针q的空间。

完形填空
完形填空。
     Look! The bus   1   at a small bus stop. A man   2   out of the window. He sees a woman. She is selling 
  3  . The man wants   4   a cake. But he doesn't want to go out because it is raining. The man sees a boy.
The boy is   5   the window. "Come here, boy," the man says. "Do you know   6   the cake is?" "Twenty fen,"
the boy says. The man   7   the boy forty fen and asks him to buy two cakes. "One is for you and the other
is for me," he says to the boy. After   8   minutes, the boy comes back. He   9   a cake. He gives the man
twenty fen and says, "Sorry, there  10  only one cake left."
( )1. A.stop    
( )2. A.looks    
( )3. A.cake    
( )4. A.buy      
( )5. A.near     
( )6. A.how much
( )7. A.buys     
( )8. A.much    
( )9. A.have    
( )10. A.are      
B.is stopping 
B.look      
B.bread      
B.buys      
B.on        
B.how many    
B.borrows    
B.a          
B.having    
B.isn't    
C.stopping  
C.is look ing  
C.cakes      
C.to buy    
C.in        
C.whose       
C.sells      
C.a few      
C.to have      
C.aren't  
D.to stop     
D.are looking 
D.breads      
D.buying      
D.of                                  
D.what        
D.gives       
D.a little    
D.has           
D.is        
单项选择题