阿摩線上測驗
登入
首頁
>
清大◆資工◆基礎計算機科學
>
110年 - 110 國立清華大學_碩士班招生考試_資訊工程學系:基礎計算機科學#105771
> 申論題
題組內容
7.(2 x 5 points) Please find the tight asymptotic upper bounds of the following recurrences in big-O notation and also justify your answers.
(b) T(n) = 2T(n-1) +n
相關申論題
8. (8 points) Given a sequence of n integers A = (a1, a2,..., an), the longest increasing subsequence problem is to find a longest subsequencealk For example, (1,2,5,8) is a longest increasing subsequence of (4,1,7,5,2,5,8,4). Please use the dynamic programming technique to design an O(n2) time algorithm for solving the longest increasing subsequence problem. Please also justify your algorithm and its time complexity.
#450299
9. (7 points) Given a set S of n numbers, the k-partition problem is to determine whether or not S can be partitioned into k subsets of the same sum. For example, let S ={1,2,9,12,18}. Then for the two-partition problem, we indeed can partition S into two subsets S1 = {1,2,18} and S2 = {9,12} such that the sum of all elements in S1 equals to the sum of all elements in S2. In fact, it can be proved that the two-partition problem is NP-complete. In the situation where the two-partition problem is already NP-complete, please prove that the three-partition problem is also NP-complete.
#450300
(a) Iff(n)= O(g(n)), we can say that g(n) ≥f(n) for n > 1.
#450301
(b) Merge Sort has worst-case time complexity O(n log n), while the worst-case time complexity of Insertion Sort is O(n2. One weakness of Merge Sort is that it requires additional space. Therefore, if space allows, we should always use Merge Sort for better efficiency.
#450302
(c) Searching a specific key in a binary search tree takes O(log n) time, where n is the number of keys in the binary search tree.
#450303
(d) Given the pre-order and level-order traversal sequences, we can construct a unique binary tree.
#450304
(a) Please sequentially insert the following keys into the given AVL tree: 17, 19, 18. Please sbow the final result of the AVL tree after all the keys are inserted. Only the final result is needed, no step-by-step illustration is required.
#450305
(b) Continue with the previous sub-problem. After the keys in sub-problem (a) are inserted, please sequentially delete keys 25 and 17 (when deleting a non-leaf node from the AVL tree, please replace it by the node with the largest key in its left subtree). Please show the final AVL tree only (no step-by-step illustration is required).
#450306
(a) (3 points) A center of a graph is a vertex that incurs the minimum eccentricity. That is, a center c is defined as:. Is it possible for a graph to have more than one center? If yes, please provide an example; If no, please provide a proof.
#450307
(b) (2 x 3 points) In contrast to the center, which must be a vertex, an absolute center is a point that can be on an edge or on a vertex, such that its maximum sbortest path distance to all vertices is minimum. Take the following graph as an example, the point x is an absolute center, because the shortest path distances from x to vertices a, b, c, d are 6.5, 2.5, 6.5, 2.5, respectively. That is, the maximum sbortest path distance from x to all the other vertices is 6.5, which is minimum among all possible cases. Given the definition of the absolute center, we know that there may be multiple absolute centers in a graph. So, please answer the following questions. (b-i) If there are multiple absolute centers in a graph, can all of them be on vertices, i.e, no absolute center is on an edge? If yes, please provide an example; If no, please provide a proof. (b-ii) If there are multiple absolute centers in a graph, can some of them be on vertices, and some of them be on edges at the same time? If yes, please provide an example; If no, please provide a proof.
#450308
相關試卷
110年 - 110 國立清華大學_碩士班招生考試_資訊工程學系:基礎計算機科學#105771
110年 · #105771