问题 单项选择题

有一个元素数很大的无序序列,现希望从中选出最大的5各元素,下列哪种方式效率最高 ( )

A.堆排序

B.快速排序

C.基数排序

D.起泡排序

答案

参考答案:A

解析:[分析] 对于一个待排序序列的键值,首先将其按堆定义建立一个堆,若采用根结点值大于左右孩子结点值的方法,首先就找到最大的键值,然后在剩下的键值中继续建堆的过程,就又找到次大的键值,如此反复,直到找到最小键值就完成了建堆的过程。

多项选择题
阅读理解
任务型阅读   。
     下面文章中有5处(第1~5题)需要添加小标题.请从以下选项(A、B、C、D、E和F)中选
出符合各段意思的小标题,选项中有一项是多余选项。
A.  Arguments are pointless.
B.  Your parents only want what's best for you.
C.  Everyone's opinion matters only as much as you want them to.
D.  You learn by doing.
E.  Your emotions are under your control.
F.  You aren't stuck in any situation.
                                                               Life is the greatest teacher
     There always comes a moment when I wonder where I will end up and this moment always serves as
a strong motivation for me to learn life lesson. I've learned a great many things, but these are the lessons
that I wish I'd learned earlier:
1. _________
     There was a time when everyone's opinion was mine as well. Whatever preferences I formerly held
were dashed in the face of another's. This most likely came from a need to please others.Remember that
your opinion matters just as much as the next guy's, whether they make more money than you or are less
popular than you. Everyone's opinion holds the same weight.
2. _________
     Drama, chaos, and emotional unrest - these were what took up most of my time as a teenager. If I
had heard someone said bad things behind my back, I'd be angry. Go crazy. Looking back on those
tantrums now, I'm not too surprised. After all, when you have little self control, anything is possible.The
lessons here is, remain aware of how you react.
3. _________
     Will one small quarrel among friends decide the fate of the entire universe? In my world it felt like it. I
just wanted so much to be right and for them so much to be wrong. But in the end, it only resulted in me
wasting my time and in the other person storming off in frustration.Is there really a point to arguing?
Unless it's absolutely necessary, I've learned that it's better to hold your breath on things you can't control
at all.Arguing to change someone's mind is one of them.
4. _________
     I'm not saying every parent wants what's best for you (there are outliers), but in general, parents do
what they do for you in your best interest.My parents used to make me do the dishes, cook dinner,
sweep the floors, mow the lawn, take out the garbage…
5. _________
     Whenever I'd lose a friend, get an awful grade, or disappoint my parents, I stewed in my own muck. Waiting for the bad moments to go away seemed to be the only solution. Fortunately, I know now that you don't have to be stuck in bad situations.You can go out and create better ones.It all depends on perspective; on how you see the situation. Viewing everything as a learning experience makes life more pleasurable, even during the hard times.You aren't stuck. You can move on.
     I'm glad to have learned these lessons the way I did. Each experience helped shape me to become a better person. I don't know if any young people are reading this, but if they are, I'd like to say this:"Listen to life and its experiences. Everyone goes through mostly the same things."