问题
单项选择题
冒泡排序在最好情况下的时间复杂度为( )。
A.O(1)
B.O(log2n)
C.O(n)D.O(n2)
答案
参考答案:C
解析: 若初始序列为“正序”,则只需进行一趟排序,在排序过程中进行n-1次比较,且不移动记录,因此时间复杂度为n。
冒泡排序在最好情况下的时间复杂度为( )。
A.O(1)
B.O(log2n)
C.O(n)D.O(n2)
参考答案:C
解析: 若初始序列为“正序”,则只需进行一趟排序,在排序过程中进行n-1次比较,且不移动记录,因此时间复杂度为n。
It was the first day of biology class. The teacher wanted to give a good 41 to his class. He wanted to 42 his students’ eyes to the world of biology. He knew that 43 young students was not easy, so he worked 44 and tried to find a good way to teach this class. 45 thinking for a long time, he made a 46 at last. He decided to show the kids something 47 and teach them a lesson at the same time. He asked his students to 48 carefully. Then he began. He put a worm(虫子) into a glass of water. The worm 49 around in the water. Then he put a second worm into a glass full of alcohol(酒精). It died at once. He asked the students if anyone knew about 50 they learned from it. A boy said, “You showed us that if we drink alcohol we won’t have worms.”
|