4.If devide-and-conquer strategy is used to find the closest pair of points in a plane, unless the points are sorted not only by their x coordinates but also by their y coordinates, it would be impossible to solve it in a time of O(NlogN), where N is the number of points.
T
F
5.用向量和单链表表示的有序表均可使用折半查找方法来提高查找速度。
T
F
选择题
1.When solving a problem with input size N by divide and conquer, if at each stage the problem is divided into 8 sub-problems of equal size N/3, and the conquer step takes O(N2logN) to form the solution from the sub-solutions, then the overall time complexity is __.
选项
A
O(N2logN)
B
O(N2log2N)
C
O(N3logN)
D
O(Nlog8/log3)
2.To solve a problem with input size N by divide and conquer algorithm, among the following methods, __ is the worst.
选项
A
divide into 2 sub-problems of equal complexity N/3 and conquer in O(N)
B
divide into 2 sub-problems of equal complexity N/3 and conquer in O(NlogN)
C
divide into 3 sub-problems of equal complexity N/2 and conquer in O(N)
D
divide into 3 sub-problems of equal complexity N/3 and conquer in O(NlogN)
3.对N个元素的表做顺序查找时,若查找每个元素的概率相同,则平均查找长度为( )
选项
A
(N+1)/2
B
N/2
C
N
D
(N+1)*N /2
4.3-way-mergesort : Suppose instead of dividing in two halves at each step of the mergesort, we divide into three one thirds, sort each part, and finally combine all of them using a three-way-merge. What is the overall time complexity of this algorithm ?
6.When solving a problem with input size N by divide and conquer, if at each step, the problem is divided into 9 sub-problems and each size of these sub-problems is N/3, and they are conquered in O(N2 logN). Which one of the following is the closest to the overall time complexity?
选项
A
O(N2 log2 N)
B
O(N2 logN)
C
O(N2)
D
O(N3logN)
7.采用顺序查找法查找长度为n的线性表时,查找不成功的平均查找长度为( )。
n n/2 (n+1)/2 (n-1)/2
8.When solving a problem with input size N by divide and conquer, if at each step, the problem is divided into 16 sub-problems and each size of these sub-problems is N/4, and they are conquered in O(N2logN). Which one of the following is the closest to the overall time complexity?