第1 頁,共 6 頁
國立臺中教育大學
107 學年度學士班日間部轉學招生考試
計算機概論試題
適用學系:資訊工程學系二、三年級 ㄧ、選擇題 (10%) 1. (2%) 下列關於記憶體的描述何者錯誤? A. EEPROM 可用電壓高低來設定或清除記憶體內容 B. 快閃記憶體 (flash memory) 有抹寫循環次數限制 C. DRAM 必須定期對電容充電 D. SRAM 單位面積容量較 DRAM 為大 2. (2%) 若不考慮溢位 (overflow),下列位元運算何者相當於將變數 A 乘以兩倍? A. 將 A 左移 1 位元 B. 將 A 左移 2 位元 C. 將 A 右移 1 位元 D. 將 A 右移 2 位元 3. (2%) 下列何者為數據機 (modem) 之功能? A. 2 進位數字與 10 進位數字互相轉換 B. 同步與非同步訊號互相轉換 C. 類比與數位訊號互相轉換 D. ASCII 碼與 EBCDIC 碼互相轉換 4. (2%) 網路線雙絞線兩兩成對互絞的原因為何? A. 固定線材 B. 整齊美觀 C. 增加傳輸速率 D. 抵消電磁波 5. (2%) 使用具以下何種功能的路由器 (router) 有助於解決 IP 位址數量不足問題? A. DHCP (Dynamic Host Configuration Protocol)B. NAT (Network Address Translation) C. Multicast
第2 頁,共 6 頁
二、Please select the correct answer in the following questions. (20%) 6. (2%) Pointers are variables that contain __________ as their values
A. strings B. offset
C. memory addresses D. directions
7. (2%) Creating a new name with typedef __________. A. creates a new type
B. creates a new type name C. creates a new variable name D. creates a new variable
8. (2%) Arrays of structures ________.
A. are automatically passed call-by-reference B. are automatically passed call-by-value C. cannot be passed call-by-reference D. cannot be passed call-by-value
9. (2%) Variables declared in a block or in the parameter list of a function are assumed to be of storage class unless specified otherwise.
A. static B. extern C. auto D. register
10. (2%) Which is the ostream member function is used to perform unformatted output in C++.
A. recv() B. send() C. read() D. write()
第3 頁,共 6 頁
11. (2%) In C++, a base class’s members are accessible within that base class and anywhere that the program has a handle to an object of that class or one of its derived classes.
A. share B. private C. protected D. public.
12. (2%) When an object of a derived class is instantiated in C++, the base class’s is called implicitly or explicitly to do any necessary initialization of the base-class data members in the derived-class object.
A. member functions B. data members C. constructor D. destructor
13. (2%) Which class contains at least one pure virtual function. A. base class
B. derived class C. abstract class D. concrete class
14. (2%) Classes from which objects can be instantiated are called classes. A. base class
B. derived class C. abstract class D. concrete class
15. (2%) _________ involves using a base-class pointer or reference to invoke virtual functions on base-class and derived-class objects.
A. Class B. Object C. Inheritance D. Polymorphism
第4 頁,共 6 頁
三、Please select the correct output of the following code fragment. (20%) 16. (4%) cout << ceil( -fabs( -8 + floor( -5.5 ) ) ) << endl;
A. -14.0 B. 14.0 C. -13.5 D. 13.5 17. (4%) int x1=10, x2=-20, *p1, *p2; p1 = & x1; p2= & x2; p2=p1; cout << *p1 + *p2 << endl; A. 10 B. -10 C. 20 D. -20 18. (4%) int A[4][4], x, y; for(x=0;x<4;x++) for(y=0;y<4;y++) A[x][y]=(x==y)?9:(x+y); for(x=0;x<4;x++) { for(y=0;y<4;y++) cout << A[x][y] << " "; cout << endl; } A. 9 1 2 3 1 9 3 4 2 3 9 5 3 4 5 9 B. 0 1 2 3 1 2 3 4 2 3 4 5 3 4 5 6 C. 0 0 0 0 1 1 1 1
第5 頁,共 6 頁 2 2 2 2 3 3 3 3 D. 0 0 0 0 0 1 2 3 0 2 4 6 0 3 6 9
19. (4%) int f(int x, int y) {
return (x>y)?-1:(x==y)?1:x*f(x+2, y); } int main() { cout << f(4,4) <<endl; return 0; } A. 2 B. 1 C. -2 D. -1
20. (4%) int f(int x, int y) { if(x < y) return 0; else if(x==y) return x + f(x-1,y); else return x + f(x-2,y-1); } int main() { cout << f(5,5) << endl; return 0; } A. 2 B. 4 C. 5 D. 8
第6 頁,共 6 頁 四、簡答題 (20%) 1. 請將下列數字做進位轉換: (a) (5%) (-25.625)10轉成2 進位的 2 補數 (b) (5%) (163)7轉成5 進位 2. (10%) 請說明記憶體架構的時間區域性(temporal locality)和空間區域性(spatial locality)。
五、Please answer the following questions (30%)
1. (10%) Suppose we are to sort a list of 10 records with keys 20, 2, 15, 30, 8, 22, 10,5,9,13 using heap sort. Show the detailed status of the heap STEP by STEP for each call of heap sort.
2. (10%) Use the following data structure to write a recursive C function (or pseudo code) to determine the depth of a binary tree. Note that the depth of a binary tree consisting of a single node is 1.
struct node { int data;
struct node *left; struct node *right; }
int depth(struct node *tree) {
}
3. (10%) A series of messages is to be transferred between two computers over the Internet. The messages comprise just the characters A through E. Analysis has shown that relative frequency of occurrence of each character is as follows: A=0.2, B = 0.35, C = 0.2, D=0.1, E=0.15 Use Huffman coding to derive a codeword set by constructing the corresponding Huffman code tree. List a possible codeword for this system.