问题 单项选择题

设平衡的二叉排序树(AVL树)的结点个数为n,则其平均拉索长度为

A.O(1)

B.O(log2

C.O(

D.O(nlog2

答案

参考答案:B

解析:
解析:平衡二叉树又称AVL树,它或者是一棵空树,或者是具有下列性质的二叉树:它的左子树和右子树都是平衡二叉树,且左子树和右子树的深度之差的绝对值不超过1,若将二叉树上结点的平衡因子BF定义为该结点的左子树的深度减去它的右子树的深度,则平衡二叉树上所有结点的平衡因子只可能是-1、0和1。只要二叉树上有一个结点的平衡因子的绝对值大于1,则该二叉树就是不平衡的。因为AVL树上任何结点的左右子树的深度之差都不超过1,则可以证明它的深度和log2n是同数量级的(N为结点个数)。因此,它的平均查找长度也和log2n同数量级。

阅读理解

阅读理解。

     General Airport Tips

     Plan to get to the airport at least an hour early, or two during holidays and other busy times; this will

reduce the stress of the flight. If all goes well, you will have time to relax, shop for last-minute items, or

have a meal before the flight.

      Flight Delays

     Find out why your flight is delayed. Call the free call numbers. Find out if other airlines are experiencing

similar delays. If you believe the delay is due to something other than weather or air traffic problems, then

mention your suspicion (怀疑) and ask the airline agent to book you on the next available flight, either on the

same air-line or a competing one. This is called "Rule 240", and all airlines are required to do it. Use the lingo

(行话); ask,"Can you 240 me?" when speaking with an agent. They will know what you mean.

     Flight Cancellations (取消)

     If your flight is canceled, then make a reservation on the next flight to your destination. Usually, air-line

personnel will try to book everyone on their next flight out. Often they will put you on a competitor's next

flight only if you request it. If on-time arrival is important to you, when you check flights through our

reservation system you can rate your choices based on their on-time arrival records. Be sure to also check the

weather conditions, as they often affect flight schedules.

1. A person goes to the airport ahead of time mainly to _______.

A. buy what he wants in the airport

B. have a good rest in the airplane

C. reduce the pressure of the flight

D. get on the airplane immediately

2. If a person calls "Rule 240", he wants to _______.

A. change for the ticket to the next flight

B. make sure the time for the next plane

C. know if other flights' delays happen

D. ask the reason for the plane delay

3. After a flight cancellation, a passenger can_______.

A. arrive at his destination on time

B. be arranged on a competing flight

C. make sure the weather is quite fine

D. reserve the next flight to your destination

4. The purpose in writing this text is to________.

A. show us how to get on a plane

B. tell us what to do before and after a flight

C. put forward suggestions for a flight

D. teach us actions before an emergency

单项选择题