问题 单项选择题

设栈S和队列Q的初始状态为空,元素按照a、b、c、d、e的次序进入栈S,当一个元素从栈中出来后立即进入队列Q。若队列的输出元素序列是c、d、b、a、e,则元素的出栈J顷序是 (58) ,栈S的容量至少为 (59)

(59)处填()。

A.2

B.3

C.4

D.5

答案

参考答案:B

解析:

[分析]: 本题考查栈和队列的基本概念及运算。

栈是先进后出的线性表,而队列是先进先出的线性表。若队列的输出元素序列为c、 d、b、a、s,则进入队列的元素序列也为c、d、b、a、e,这也是从栈中出来的元素序列。

若元素以a、b、c、d、e的次序进入栈S且得到输出序列c、d、b、a、e,则操作系列为a入栈、b入栈、c入栈、c出栈、d入栈、d出栈、b出栈、a出栈、e入栈、s出栈。第一个出栈的元素为c,则c出栈时元素a和b尚在栈中,如下图所示。

 

栈S的容量至少为3。

完形填空
完形填空。
     These days computer games have become more and more popular in many cities and towns. A lot of small
shops along busy  1  have changed into computer game houses in order to get more  2 . These places are
always crowded with people.
     In the computer game houses, people  3  a lot of money matching on the machines. It's  4  for one to beat a
computer, but one can do well after trying again and again. People want to  5  when they play computer games.
The more they  6 , the more they want to win, and at last they even can't  7  without it.
     The result is that some people don' t want to  8 , and they play in computer game houses for hours and hours. For school boys, things are  9 . They don't want to have  10 . When school is over, they rush to the computer
game houses near their  11 . Some of them can get enough money from their  12 . Some of them are  13   
enough to get the money. So they have to steal or rob others' and become  14 .
     Computer game addiction (上瘾) is a  15  problem in our life. Something has to be done to stop it.
( )1. A. streets    
( )2. A. boys       
( )3. A. take       
( )4. A. possible   
( )5. A. read       
( )6. A. lose       
( )7. A. come       
( )8. A. watch TV   
( )9. A. better     
( )10. A. lessons   
( )11. A. classes   
( )12. A. classmates
( )13. A. lucky     
( )14. A. good      
( )15. A. important 
B. schools
B. money  
B. spend  
B. easy   
B. learn  
B. try    
B. eat    
B. go out 
B. exciting
B. games  
B. rooms  
B. teachers
B. unlucky
B. bad    
B. serious
C. towns    
C. computers
C. cost     
C. good     
C. win      
C. waste    
C. study    
C. stay there
C. even worse
C. families 
C. schools  
C. sisters  
C. careful  
C. rich     
C. unusual  
D. cities    
D. houses    
D. pay       
D. hard      
D. download  
D. watch     
D. live      
D. work      
D. interesting                                   
D. sports    
D. shops     
D. parents   
D. polite    
D. poor      
D. wonderful 
填空题