问题 单项选择题

在查找算法中,可用平均查找长度(记为ASL)来衡量一个查找算法的优劣,其定义为:

此处Pi为表中第i个记录被查找的概率,Ci为查找第i个记录时同关键字比较的次数,n为表中记录数。

以下叙述中均假定每一个记录被查找的概率相等,即Pi=//n(i=1,2,…,n)。当表中的记录连续存储在一个一维数组中时,可采用顺序查找与折半查找方法(折半查找要求表是按关键字有序排列的)。顺序查找时的ASL为 (1) ,折半查找时的ASL为 (2) 。记录的关键字有序时,用二叉排序树查找记录,在最坏的情况下,ASL为 (3) 。当二叉排序树是一棵平衡树时,ASL为 (4) 。在平衡树上删除一个结点后可以通过旋转使其平衡,最坏的情形下需 (5) 次旋转。

1()

A.O(1)

B.O(log2n)

C.O(log2n2)

D.O(nlog2n)

E.O(n)

F.O(n2)

答案

参考答案:E

完形填空

根据短文内容,从短文后的选项中选出能填入空白处的最佳选项。选项中有两项为多余选项。

Cheating is when a person misleads, deceives or acts dishonestly on purpose.  小题1:  If a basketball team is for kids under 8, it's cheating for a 9-year-old play on the team. At school, in addition to cheating on a test, a kid might cheat by stealing someone else's idea for a science project.   小题2:  This kind of cheating is called plagiarizing (抄袭).

  小题3:  Jeff is doing it by sneaking answers to a test. And it's also cheating to break the rules of a game or contest or to pretend something is yours when it isn't. When people cheat, it's not fair to other people.

It's tempting(诱惑人的) to cheat because it makes difficult things seem easy, like getting all the right answer on the rest.   小题4:  And it won't help on the next test-unless the person cheats again.

  小题5:  They want to get good grades but hate hard work. Other kids might feel like they can't pass the test without cheating. Even though there seems to be a "good reason" for cheating, cheating isn't a good idea.

A.Some kids cheat because they're lazy.

B.Cheating can happen in a lot of different ways.

C.But it doesn't solve the problem of not knowing the material.

D.Some kids cheat once and feel so bad that they never do it again.E. For kids, cheating may happen at school, at home, or while playing a sport.

F. There are plenty of reasons why a kid shouldn't cheat, but some kids have already cheated.                  

G. Kids may also cheat by copying a book report off the Internet and handing it in as it's his or her original work.

单项选择题