冒泡排序(Bubble Sort) .也称为沉降排序(Sinking Sort) , 之所以称其为冒泡排序,是因为算法
中值相对较小的数据会像水中的气泡一样逐渐上升到数组的最顶端,与此同时,较大的数据逐渐地下沉到数组的底部。这个处理过程需要在整个数组范围内反复执行多遍。每一遍执行时,比较相邻的两个元素,若顺序不对,则将其位置交换,当没有数据需要交换时, 数据也就排好序了。编程将排序函数DataSort() 改用冒泡法实现。
中值相对较小的数据会像水中的气泡一样逐渐上升到数组的最顶端,与此同时,较大的数据逐渐地下沉到数组的底部。这个处理过程需要在整个数组范围内反复执行多遍。每一遍执行时,比较相邻的两个元素,若顺序不对,则将其位置交换,当没有数据需要交换时, 数据也就排好序了。编程将排序函数DataSort() 改用冒泡法实现。
第5题
若用冒泡排序法对序列18,14,6,27,8,12,16,52,10,26,47,29,41,24从小到大进行排序,共要进行()次比较。
A.33
B.45
C.70
D.91
第7题
It is now clear that this is not so. Babies will learn to behave in ways that produce results in the world with no reward except the successful outcome.
Papousek began his studies by using milk in the normal way to "reward" the babies and so teach them to carry out some simple movements, such as turning the head to one side or the other. Then he noticed that a baby who had had enough to drink would refuse the milk but would still go on making the learned response with clear signs of pleasure. So he began to study the children's responses in situations where no milk was provided. He quickly found that children as young as four months would learn to turn their heads to right or left if the movement "switched on" a display of lights-and indeed that they were capable of learning quite complex turns to bring about this result. For instance, two left or two right, or even to make as many as three turns to one side.
Papousek's light display was placed directly in front of the babies and he made the interesting observation that sometimes they would not turn back to watch the lights closely although they would "smile and bubble ''when the display came on. Papousek concluded that it was not primarily the sight of the lights which pleased them, it was the success they were achieving in solving the problem, in mastering the skill, and that there exists a fundamental human urge to make sense of the world and bring it under intentional control.
According to the author, babies learn to do things which ______. ()
A.are directly related to pleasure
B.will meet their physical needs
C.will bring them a feeling of success
D.will satisfy their curiosity
第8题
The babies would "smile and bubble" at the lights because ______.
A.the lights were directly related to some basic "drives"
B.the sight of the lights was interesting
C.they need not turn back to watch the lights
D.they succeeded in "switching on" the lights
第9题
(d) Explain how Gloria would be taxed in the UK on the dividends paid by Bubble Inc and the capital gains tax
and inheritance tax implications of a future disposal of the shares. Clearly state, giving reasons, whether or
not the payment made to Eric is allowable for capital gains tax purposes. (9 marks)
You should assume that the rates and allowances for the tax year 2005/06 apply throughout this question.