问题 单项选择题

迪杰斯特拉(Dijkstra)算法用于求解图上的单源点最短路径。该算法按路径长度递增次序产生最短路径,本质上说,该算法是一种基干()策略的算法。

A.分治

B.动态规划

C.贪心

D.回溯

答案

参考答案:C

解析:

[分析]: 本题考查算法的设计策略。

单源点最短路径问题是指给定图G和源点v0,求从v0到图G中其余各项点的最短路径。迪杰斯特拉(Dijkstra)算法是一个求解单源点最短路径的经典算法,其思想是:把图中所有的顶点分成两个集合S和T,S集合开始时只包含顶点v0,T集合开始时包含图中除了顶点v0之外的所有顶点。凡是以v0为源点,已经确定了最短路径的终点并入S集合中,顶点集合T则是尚未确定最短路径的顶点集合。按各顶点与v0间最短路径长度递增的次序,逐个把T集合中 的顶点加入到S集合中,使得从v0到S集合中各顶点的路径长度始终不大于从v0到T集合中各顶点的路径长度。该算法是以一种贪心的方式将T集合中的顶点加入到S集合中的,而且该贪心方法可以求得问题的最优解。

完形填空
完形填空。
     I always got a flower on my suit on Sunday service, I really didn't think much of it. One Sunday a little
boy   1   me when I was leaving. He walked right up to me and said, "What are you going to   2   with your
flower?" At first I did not know   3   he was talking about, but then I understood.
      I said, "Do you mean this?" as I pointed to the rose   4   to my coat.
     He said, "Yes sir. I would use it   5   you are just going to throw it away." At this point I   6   and gladly
told him that he could have my flower, casually (顺便)   7   him what he was going to do with it. The little
boy said,"Sir, I am going to   8   it to my granny. My mother and father got divorced two years ago, my
grandmother   9   me and so I want to give that  10  flower to her."
     When he finished I could   11   speak. And my eyes were filled with tears and I knew I had been   12   in
the depth of my soul. I   13   up and unpinned my flower. With the flower in my   14  , I looked at the boy
and said, "Son you   15   have this flower because it's not enough. If you   16   in front of the pulpit (教堂
讲坛), you'll see a big bouquet (束) of flowers. Please take those   17   to your granny because she deserves
(应得) the very
   18   ."
      The boy made one last  19   . He said, "What a   20   day! I asked for one flower but got a beautiful
bouquet. I'll always cherish (珍惜) it."
( )1. A. surrounded(围绕)  
( )2. A. do                
( )3. A. why              
( )4. A. tied            
( )5. A. though           
( )6. A. smiled            
( )7. A. telling           
( )8. A. give           
( )9. A. looks forward to  
( )10. A. ugly             
( )11. A. never           
( )12. A. caught          
( )13. A. reached         
( )14. A. heart           
( )15. A. must            
( )16. A. look          
( )17. A. words         
( )18. A. worst            
( )19. A. choice          
( )20. A. wonderful      
B. appreciated    
B. change         
B. who            
B. pinned         
B. unless          
B. shouted         
B. asking          
B. fetch           
B. gets away from 
B. expensive       
B. hardly         
B. lost          
B. climbed        
B. hand          
B. can            
B. lie            
B. pulpits        
B. best          
B. statement(陈述)
B. terrible       
C. approached      
C. talk             
C. how               
C. aimed            
C. if               
C. cried            
C. testing          
C. pay             
C. catches up with  
C. old              
C. even               
C. buried          
C. gathered          
C. soul            
C. can’t           
C. wait             
C. flowers          
C. little          
C. decision         
C. formal         
D. walked                 
D. share                 
D. what                     
D. stuck                  
D. until                  
D. jumped                 
D. examining              
D. have                   
D. takes care of           
D. pretty              
D. still                     
D. touched              
D. brought                 
D. eye                    
D. should                 
D. run                    
D. gifts                   
D. better                
D. introduction           
D. peaceful            
单项选择题