试题与答案

设待排序关键码序列为(25,18,9,33,67,82,53,95,12,70)。要

题型:单项选择题

题目:

设待排序关键码序列为(25,18,9,33,67,82,53,95,12,70)。要按关键值递增的顺序进行排序,采取以第一个关键码为分界元素的快速排序法,第一趟完成后关键码33被放到了第几个位置?

A.3

B.5

C.7

D.9

答案:

参考答案:D

解析:快速排序第一趟完成后的结果为:12,18,9,25,67,82,53,95,33,70。所以33被放到了第9个位置。

试题推荐
题型:阅读理解
阅读下列短文,根据短文中的信息完成文后表格。(每空一词)
Almost all of us have unpleasant habits. We all want to get rid of(摆脱) them, but we don’t know proper ways. Here’s some advice.
●Write down all the reasons why you want to stop some behavior. Look at the reasons very often.
●It’s clever to do something else when you want to stop your bad habits. If you get angry easily, for example, you can go out for a walk.
●Decide what you’ll do to reward(奖励) yourself if you really get rid of your bad habits.
●If you get too heavy, keep junk food out of your house.
●Bad habits develop over years, so you can’t get rid of them very soon. So you should be patient.
●Don’t be afraid to ask others for support. You can talk to your friends, family or other people. When you talk to them, they might be able to provide some advice that you can’t get from yourself.
__小题1:__to Get Rid of Bad Habits
Make a list
Write down all the reasons __小题2:__  you want to get rid of your bad habits.
Join in some __小题3:__
You’d better do something else when you want to stop your bad habits.___小题4:___out for a walk can help you if you get angry easily.
__小题5:__ yourself a reward
Decide how to reward yourself if you are __小题6:__  in getting rid of your bad habits.
Keep off your bad habits
___小题7:___ away from junk food if you want to be thinner
Be patient
It’s ___小题8:___ to get rid of a bad habit in a short time.
Ask for __小题9:__
When you talk to others, they may give you some___小题10:___
查看答案
微信公众账号搜索答案