问题 单项选择题

对于长度为n的线性表,在最坏情况下,下列各种排序法所对应的比较次数中正确的是( )。

A.冒泡排序为n/2

B.冒泡排序为n

C.快速排序为n

D.快速排序为n(n-1)/2

答案

参考答案:D

解析: 在最坏情况下,冒泡排序和快速排序的比较次数都是n(n-1)/2。所谓冒泡排序,就是将相邻的两个数据比较,如前面的数据大于后面的,则位置互换。这样不停地比较、互换,其实就是把大的数往后排,小的数往前排(就像冒泡一样冒出来了)。

多项选择题
阅读理解

阅读理解。

     Besides entertainment and beautiful lanterns, another important part of the Lantern Festival , or

Yuanxiao Festival is eating small dumpling balls made of glutinous rice flour. We call these balls Yuanxiao

or Tangyuan. Obviously, they get the name from the festival itself. It is said that the custom of eating

Yuanxiao originated during the Eastern Jin Dynasty in the fourth century, then became popular during the

Tang and Song periods.

     The fillings inside the dumplings or Yuansiao are either sweet or salty. Sweet fillings are made of sugar, Walnuts, sesame (芝麻), osmanthus flowers (桂花), rose petals, sweetened tangerine (橘子)peel, bean

paste, or jujube paste (枣子酱). A single ingredient or any combination can be used as the filling . The

salty variety is filled with minced meat (肉末儿), vegetables or a mixture.

     The way to make Yuanxiao also varies between northern and southern China. The usual method

followed in southern provinces is to shape the dough of rice flour into balls, make a hole, insert the filling,

then close the hole and smooth out the dumpling by rolling it between your hands. In North China, sweet

or nutmeat stuffing is the usual ingredient. The fillings are pressed into hardened cores, dipped lightly in

water and rolled in a flat basket containing dry glutinous rice flour. A layer of the flour sticks to the filling,

which is then again dipped in water and rolled a second time in the rice flour. And so it goes, like rolling a

snowball, until the dumpling is the desired size.

     The custom of eating Yuanxiao dumplings remains. This tradition encourages both old and new stores

to promote their Yuanxiao products. They all try their best to improve the taste and quality of the dumplings to attract more customers.

1. Which of the following is NOT true? 

A. The custom of eating Yuanxiao dates back to the fourth century.

B. Sugar, rose petals and minced meat are all fillings of Yuanxiao.

C. Sweet Yuanxiao are usually made in southern China.

D. People in northern China usually make Yuanxiao by rolling like a snowball.

2. Which country does the Lantern Festival come from?

A. China     

B. South Korea    

C. Jin Dynasty      

D. Tang and Song periods.

3. Choose the right order of making Tangyuan in southern provinces.

  ① make a hole and insert the filling  

  ② roll the dough between your hands  

  ③ shape the dough of rice flour into balls  

  ④ close the hole  

  ⑤ prepare some rice flour

A. ⑤③②①④  

B. ③⑤①②④  

C. ③①④②⑤  

D. ⑤③①④②