• 沒有找到結果。

程式設計

N/A
N/A
Protected

Academic year: 2021

Share "程式設計"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

1

國立台中教育大學九十五學年度研究所碩士班招生考試

程式設計 科試題

一、選擇題(共 10 題,每題 5 分)

Please answer question 1-5 based on the following situations (1) A hash table of size m is used to store n items, with

2

m

n≤ , and the load factor n

m

α = .

(2) Open addressing is used for collision resolution.

(3)Xi denotes the number of probes required by the i-th insertion, where i=1, 2,L ,n

(4) 1 max i i n X X ≤ ≤

= denotes the maximum number of probes required by any of the n insertions. 1. What is the expected number of probes in a successful search at most?

c 1ln 1 1 α −α d 1 ln α e 1 ln (1 ) α −α f 1 1 ln 1−α α 2. What is the expected number of probes in an unsuccessful search at most?

c 1 α d 1 1−α e 1 (1 ) α −α f1 α α −

3. Let p is the probability of i Xi >2 log2n. Which of the following statements is correct? cpi ≤ α d pi > α e pi 12

n

> fpi 12

n

4. Let p is the probability of X >2 log2n. Which of the following statements is correct? cp 1 α ≤ d p 1 α > e p 1 n > fp 1 n

5. Assuming uniform hashing, what is the probability that the i-th insertion requires strictly more than k probes at most?

c 1 2k d 1 k α− e 1 k f 1 ln k

6. If a n-element heap with height h, how many nodes will be at most? c     +1 2h n d     +1 2h n e     −1 2h n f     −1 2 log hn

7. Which of the following arrays are NOT binary heaps?

c 1,1,1,1,1 d 6,5,4,3,2,1 e 6,4,2,3,1,2 f 6,4,3,1,3,4 8. What is the rank by order of growth for the following:

2 n ,n!, 2n 2 ,log2n, 2n 2 ,n log n ,

n2

n,

n

3? c nlog n ,log2 n,n2,

n

3,

n2

n ,n!,22n,22n d log2 n,nlog n ,n2,

n

3,

n2

n ,n!,22n,22n e log2 n,nlog n ,n2,

n

3,

n2

n ,22n,n!,22n f 2 n log ,nlog n ,n2,

n

3,

n2

n ,22n,22n,n! 測統資訊組、數教資訊組 用 背面尚有試題

(2)

2 9. Suppose the following letters have the indicated frequency in a message. What is the

average Huffman code length?

Key Frequency A B C D 7 3 4 1 Total 15 c 5 9 d 15 28 e 15 29 f 2

10. Use the double-ended queue (dequeue) to input: 1, 2, 3, 4, 5, 6, and 7 sequentially. In the following, what are the impossible outputs?

c 5174236 d 1234567 e 2143756 f 7615243 g4213765 二、問答題(共 5 題,每題 10 分) 1. 請以 binary search 設計一段演算法,搜尋下列資料中的數字 50 資料列: 37, 57, 23, 15, 50, 32, 80, 12, 19, 21 2. 請寫ㄧ程式使用 Bubble Sort 將陣列 X[n]內所有元素,由小到大重新排列,並將 結果印出。 3. 試述關聯式資料庫(Relational Database)的正規化(Normalization)中,第一正規化 (First Normal Form)、第二正規化(Second Normal Form)、第三正規化(Third Normal Form)及 Boyce-Codd 正規化。

4. Please write out a recursive program to calculate the Great Common Divisor. (10%) 5. Assume that there is an integer number series: 2, 8, 10, 13, 14, 15, 21, 26, 33, 34, 38,

50. Please search 10 and 36 in this number series by Interpolation Search algorithm, and describe the searching procedure step by step. (10%)

參考文獻

相關文件

「公告品名成份規格」欄位預設帶入公告資料,請依

其他光學儀器及設備製造業 從事 2771 細類以外光學儀器及設 備製造之行業,如望遠鏡、顯微

(一)機關主要職掌:本局組織規程奉考試院 101.8.1 考授銓法五字第 1013628775 號函發布,掌理全市教育行政業務,組織規程修正經考 試院 107.4.11

既然一個 finite normal extension 是一個 polynomial 的 splitting field, 我們可以利用 The Fundamental Theorem for Splitting Field (Theorem 3.1.6) 得到以下有關

同樣的, 將 Theorem 2.6.5 中的 group 換成 ring 及 normal subgroup 換成 ideal, 我們有以下之第三 isomorphism 定理:.. Theorem 6.4.5 (Third

規劃順序:第二層 → 第一層 → 第三層 →

代碼 姓名 姓別 住址 電話 部門 部門 位置..

校本文化 文化 文化及 文化 及 及文學課程 及 文學課程 文學課程整體規畫 文學課程 整體規畫 整體規畫 整體規畫. 一年級 二年級 三年級