(完整word版)哈工大深圳算法设计与分析试卷-师兄只能帮你到这啦(额外再加8道保命题)-何震宇
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1、Using figure to illustrate the operation of RADIX-SORT on the following list of English words: COW, DOG , SEA, RUG , ROW, MOB, BOX, TAB.
2、Please write inorder, preorder and postorder tree walks of the following binary search tree.
3、Please write down the elements of dynamic programming.
4、Using a recursion tree to give an asymptotically tight solution to the recurrence T(n) = T(n/3)+T(2n/3)+cn.
5、Please give an optimal Huffman code for the following set of frequencies. a b c d e f Frequency 5 9 16 12 13 45
6、Converting the following linear program into standard form:
Minimize 2172x x +
Subject to 71=x
24321≥+x x
02≥x
03≤x
7、Solve the following linear program using SIMPLEX:
maximize 215.1218x x +
Subject to 2021≤+x x
121≤x
162≤x
0,21≥x x
8、Suppose A1 a 105⨯ matrix, A2 a 310⨯ matrix, A3 a 123⨯ matrix, A4 a 512⨯ matrix, A5 a 505⨯ matrix, A6 a 650⨯ matrix. Please give an optimal parenthesization of a matrix-chain A1A2A3A4A5A6.
9、Using a recursion tree to give an asymptotically tight solution to the recurrence T (n ) = T(n/4)+T(n/2)+ n 2.
10、Using figure to illustrate the operation of COUNTING-SORT on the array A=<6,0,2,0,1,3,4,6,1,3,2>
11、Using figure to illustrate the operation of RADIX-SORT on the following list of English words: COW, DOG , SEA, RUG , ROW, MOB, BOX, TAB.
12、Please write inorder, preorder and postorder tree walks of the following binary search tree.
14、Please give an optimal Huffman code for the following set of frequencies.
15、Please draw the result after the operation Left-Rotate(9)
.
18、A red-black tree (RB tree) is a binary search tree with one extra bit of storage per node: its color, which can be either RED or BLACK, and the red-black is a nearly balanced tree. Please prove n-node RB tree has height )(lg n O h =
19、Solve the following linear program using SIMPLEX:
maximize 215.1218x x +
Subject to 2021≤+x x
121≤x
162≤x
0,21≥x x
20、In the activity-selection problem,
}:{j k k i k ij s f s f S a S ≤≤≤∈= represents the activities that start after an activity
i a finishes and finish before one activity j a starts. Here, an activity i a occurs during period ),[i i f s , and activities are sorted by
monotonically increasing finish time. Let
Φ≠ij S , and let m a be the activity in ij S with the earliest finish time: }:min{ij k k m S a f f ∈=. Then prove m a is used in some maximum-size subset of mutually compatible activities of ij S