问题 填空题

对于关键码序列18,30,35,10,46,38,5,40进行堆排序(假定堆的根结点为最小关键码),在初始建堆过程中需进行的关键码交换次数为 【5】

答案

参考答案:C

解析: 堆排序是完全二叉树的一个重要应用,可以解释为完全二叉树中的任一节点的关键码都小于或等于它的两个子女的关键码。排序的基本思想是:对一组待排序的关键码首先把他们按照堆的定义排成一个序列(建堆),取出最小关键码,余下的关键码再建堆,再取出最小关键码,如此反复,直到全部关键码排序完毕。本题的解答步骤为:第一次:18,30,5,10,46,38,35,40。第二次:18, 10,5,30,46,38,25,40。第三次;5,10,18,30,46,38,35,40。3次以后就可以了。

填空题
完形填空
完形填空。
     The day was Thankful Thursday. It's a weekly   1   that my two little girls and I began years ago.
Thursday has become our day to go out and make a positive   2  .
     My girls shouted "McDonald's, McDonald's" as we   3   along a busy Houston road. Suddenly I   4 
 that almost every crossing I passed through was   5   by a panhandler (乞丐). And then it hit me! All
these panhandlers must be hungry, too. Perfect! After we ate, I ordered a(n)   6   15 lunches and we set
out to deliver them. We would pull   7   a panhandler, make a contribution, and tell him or her that we
hoped things got better. Then we'd say, "Oh,   8  , here's lunch."
     We handed our final contribution to a small woman and then immediately   9   back in the opposite
direction for home.  10 , the light caught us again and we were stopped at the same crossing where this
small woman stood. I was  11  and didn't know quite how to behave.
     She made her way to our car, "No one has ever done  12  like this for me before," she said with  13 .
Feeling uneasy, and wanting to move the conversation along, I asked, "So,  14  do you think you'll eat
your lunch?"
     She just looked at me with her huge, tired brown eyes and said, "Oh honey, I'm not going to eat this
lunch." I was  15 , but before I could say anything, she continued, "You see, I have a little girl and she just
loves McDonald's, but I don't have the money. But you know  16  tonight if she is going to have
McDonald's!"
     I don't know if the kids  17  the tears in my eyes. So many times I had questioned whether our acts of
kindness were too  18  or insignificant to really affect change.  19  in that moment, I recognized the  20 
 of Mother Teresa's words:"We cannot do great things-only small things with great love."
( )1. A. tradition    
( )2. A. decision     
( )3. A. walked       
( )4. A. reminded     
( )5. A. crowded      
( )6. A. additional   
( )7. A. close        
( )8. A. in fact      
( )9. A. faced        
( )10. A. Unfortunately
( )11. A. excited     
( )12. A. something   
( )13. A. amazement   
( )14. A. what        
( )15. A. shocked     
( )16. A. whether     
( )17. A. realized    
( )18. A. many        
( )19. A. Therefore   
( )20. A. promise     
B. ceremony         
B. choice           
B. ran              
B. realized         
B. occupied         
B. expensive        
B. across           
B. to tell the truth
B. headed           
B. Luckily          
B. embarrassed      
B. everything       
B. fear             
B. how              
B. confused         
B. if               
B. felt             
B. small            
B. Although         
B. oath             
C. custom           
C. contribution     
C. wandered         
C. understood       
C. discovered       
C. cheap            
C. alongside        
C. generally speaking
C. turned           
C. Unexpectedly     
C. frightened       
C. anything         
C. sorrow           
C. where            
C. pleased          
C. what             
C. noticed          
C. big              
C. Meanwhile        
C. truth            
D. habit      
D. plan       
D. drove      
D. thought    
D. laid       
D. special    
D. throughout 
D. by the way 
D. looked     
D. Hopefully  
D. annoyed    
D. nothing    
D. amusement              
D. when       
D. worried    
D. that       
D. recognized 
D. simple     
D. Yet        
D. spirit