所屬科目:研究所、轉學考(插大)◆資料結構與演算法
1..(A)O(B)X
11.Which of the following is correct? (A) (B) (C)(D)
12. Let f(n) and g(n) be two asymptotically non-negative functions. Which of the following is always true? (A)(B)(C) (D)
13. Consider a divide-and-conquer algorithm, which solves a problem of size n by dividing it into two subproblems of size n/3 and n/5, respectively. The solutions of the subproblems are then combined in θ(n2) time. Which of the following is correct about the time complexity T(n) of this algorithm? (A) T(n) must be in θ(n2). (B) T(n) must be in O(n2) but not nec ssarily in Ω(n2). (C) T(n) must be in Ω(n2) but not necessarily in O(n2). (D)None of the above. The complexity of T(n) depends on the exact valuc of n.
15. Consider the problem of making change for n cents using the fewest number of coins. An algorithm to solve this problem is to give the coin with the highest available denomination without going over, and repeat the process until the amount of remaining change drops to O. Which of the following sets of available coin denominations would cause this algorithm to fail at yielding an optimal solution? (A) {1,3} (B) {1,3,4,5} (C) {1,5,10, 25} (D) {c0,c1,..,..ck) for any set of integers c > 1 and k ≥1
17. Consider the following undirected connected graph. What is the total weight of its maximum spanning tree? (A)23(B)24(C)25(D)26
18. Suppose we run Dijkstra's single-source shortest-path algorithm on the following weighted directed graph with vertex a as the source. In what order do the nodes get included into the set of verticcs for which the shortest path distances are finalized?(A) a, b, c, d, e,f (B) a, b, c,f, d,e (C) a, b, c, f,e, d (D) a, b, e, c, f, d
20. Assume P ≠NP. Which of the following is true? (A)(B)NP-complete = NP (C) NP-hard -NP (D) P=NP-complete
26. Consider the following five recursive functions: (A) (B) (C) (D) (E)Which recursion yields the highest asymptotic complexity for T(n)?
32. If Dijkstra algorithm is implemented with Binomial heap as priority qucue, then the complexity is (A) O(|V|2+|E| log|V|) (B) O(|V|2) (C) O(|E| log|V|) (D) O(|E| ||+|V| log|V|)(E) O(|E|)
33. If Dijkstra algorithm is implemented with Fibonacci heap as priority queue, then the complexity is (A) O(|V|2+|E| log |V|) (B) O(|V|2) (C) O(|E| log|V|) (D) O(|E|+I|V| log(|V|) (E) O(|E|)
35. If Dijkstra algorithm is implemented with doubly-linked Iist as prionity qucue, then the complexity is (A) O(|V|2+1Ellog|V|) (B) O(|V|2) (C) O(|E|log|V|) (D) O(|E|+|V| log|V|) (E) O(|E|)
36. Which of the following statements are true? (A) [logn]! = 0(n2) (B) (logn)n = 0(n!) (C) log(n!) = O(nlogn) (D) log* n = O(log *logn) (E)
40. Which of the following statem ents are true? (A) An insertion in AVL tree requires Ω(logn) single- and double-rotations in the worst case. (B) An insertion in AVL trce requires O(1) single- and double-rotations in the worst case. (C) A deletion in AVL tree requires Ω(logn) single- and double-rotations in the worst case. (D) Adeletion in AVL tree requires O(1) singie- and double-rotations in the worst case. (E) There is no red left child in AA tree.
47. Which of the following are desirable properties of a hash function h(x)?(A) If x1,...,xn are the items to be hashed. then the numbers h(x1),..., h(xn) should be uniformly distributed over the (B) The range of h(x) should incinde a wide r range of integers. (C) The range of h(x) should stay within the desired hash-table sizc. (D) It should be computable in O( 1) time. (E) It should take distinct values over all possible items to be hashed. integers.