问题 单项选择题

若排序前后关键字相同的两个元素相对位置不变,则称该排序方法是稳定的。()排序是稳定的。

A.归并

B.快速

C.希尔

D.堆

答案

参考答案:A

解析:

排序是将无序的记录序列调整为有序记录序列的一种操作。

直接插入排序:插入排序的准则是,在有序序列中插入新的记录以达到扩大有序区的长度的目的。

起泡排序:起泡排序是交换类排序方法中的一种简单排序方法。其基本思想为依次比较相邻两个记录的关键字,若和所期望的相反,则互换这两个记录。

希尔排序:希尔排序又称“缩小增量排序”,它的基本思想是,先对待排序列进行“宏观调整”,待序列中的记录“基本有序”时再进行直接插入排序。

快速排序:起泡排序是通过一趟“起泡”选定关键字最大的记录,所有剩余关键字均小于它的记录继续进行排序。快速排序则是通过一趟排序选定一个关键字介于“中间”的记录,从而使剩余记录可以分成两个子序列分别继续排序,通常称该记录为“轴枢”。

堆排序:利用堆的特性进行的排序方法即为“堆排序”。“堆排序”是一种选择类的排序方法。

归并排序:归并排序的基本操作是将两个或两个以上的记录有序序列归并为一个有序序列。最简单的情况是,只含一个记录的序列显然是个有序序列,经过“逐趟归并”使整个序列中的有序子序列的长度逐趟增大,直至整个记录序列为有序序列为止。2-路归并排序则是归并排序中的一种最简单的情况,它的基本操作是将两个相邻的有序子序列“归并”为一个有序序列。

基数排序:利用多关键字排序的思想。

快速排序、堆排序或归并排序平均时间复杂度较低,为O(nlogn)。直接插入排序、起泡排序、归并排序和基数排序是稳定的。

阅读理解

Homeboy Goes to Harvard University

On January 11, 2007, as students sat and listened, a very important guest speaker named Richard, spoke to the students in the lecture hall. He not only showed the potential(潜能)within young adults, but  encouraged them to work hard at their lessons.

Richard was a young child when his mother died and his father walked out. He was forced into many different foster homes(寄养家庭)where he felt unhappy. He did not know that his life was taking a turn for the worst.

His uncle, after getting out of prison, got him into drugs and alcohol. His uncle taught him that his place in life was either to be in prison or die trying to be “a man.” His uncle’s teaching almost started affecting him until a very important person came into his life: a teacher. This teacher taught him there is a place in the world for everyone and it isn’t related to drugs.

Richard is now a Harvard University graduate and has a great and loving family. Why? He was taught to have respect not only for others, but for himself.

After the meeting, it was hoped that the students realized within them there is a potential, and within everyone around them, is knowledge. As Richard reminded them, “Knowledge is power.”

小题1:On January 11, 2007, students listened to a speech made by Richard, who graduated from ________.

A.Harvard University

B.a foster school

C.his teacher’s school

D.his uncle’s university小题2:Richard encouraged the students ______.

A.to love life

B.to be a man

C.to study hard

D.to leave drugs小题3:When he was young, Richard lived a(an)_______ life in foster homes.

A.rich

B.unhappy

C.relaxing

D.interesting小题4:Who played an important role in Richard’s successful life?

A.His uncle.

B.His teacher.

C.His friends.

D.His parents.

填空题