[問題] 一堆問題...沒辦法..考試快到了咩(茶)
1. The following table represents a tree stored in a machine's memory.
Each node of the tree consists of three cells. The first cell contains
the data (a letter),the second contains a pointer to the nodes's left
child , and the third contains a pointer to the node's right child.
A value of 0 represents a NULL pointer. If the value of the root
pointer is 55 , draw a picture of the tree.
Address Contents
40 G
41 0
42 0
43 X
44 0
45 0
46 J
47 49
48 0
49 M
50 0
51 0
52 F
53 43
54 40
55 W
56 46
57 52
-------------------------------------------------------------------------
2. 想問一下Insertion Sort 的比較次數最差狀況是(n-1)*n/2還是n*(n+1)/2
(兩者差在第一個數有沒有跟負無限大做比較,若有,則是n*(n+1)/2,反之,
就是前者),不知道通常計算時比較的底值有沒有包含負無限大這一項,
還是直接拿第一個數字做比較?
-------------------------------------------------------------------------
3. An incremnetal backup copies________.
(A)all program and data files.
(B)only the files that have changed since the last full backup
(C)only the files that have changed since the last incremental backup
(D)only the files that have changed since the last full backup or
differential backup
(E)only the files that have changed since the last full backup or
incremental backup
--------------------------------------------------------------------------
4. Let A(mxn) and B(nxm) be two matrixs. Please write a pseudocode to
compute A(mxn)*B(nxm).
我這一題是這樣做的,請各位過目看看有沒有問題~
先假設所求為C(mxm),則
for(int k=0;k<m;k++)
for(int i=0;i<m;i++)
for(int j=0;j<n;j++)
C[k][i] += A[i][j]*B[j][i];
--------------------------------------------------------------------------
5.TOM買了一個宣稱200MB的硬碟(會不會太小...不過這不是重點)
但是WINDOWS顯示只有190.7MB,TOM打電話給廠商去抱怨少了9MB,但是廠商堅稱
200MB是真的,聰明的你能解釋為什麼會這樣嗎?
--------------------------------------------------------------------------
6.Please write a C program that exhibits the problem of memory leakage.
Please write another C program that exhibits the dangling pointer.
-------------------------------------------------------------------------
版眾品質,堅若磐石~!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.228.130.124
推
06/24 11:36, , 1F
06/24 11:36, 1F
推
06/24 12:23, , 2F
06/24 12:23, 2F
→
06/24 12:25, , 3F
06/24 12:25, 3F
→
06/24 12:26, , 4F
06/24 12:26, 4F
→
06/24 12:27, , 5F
06/24 12:27, 5F
→
06/24 12:29, , 6F
06/24 12:29, 6F
推
06/24 17:06, , 7F
06/24 17:06, 7F
→
06/24 17:06, , 8F
06/24 17:06, 8F
→
06/24 17:10, , 9F
06/24 17:10, 9F
→
06/24 17:11, , 10F
06/24 17:11, 10F
推
06/24 18:09, , 11F
06/24 18:09, 11F
→
06/24 18:10, , 12F
06/24 18:10, 12F
推
06/24 18:15, , 13F
06/24 18:15, 13F
→
06/24 18:15, , 14F
06/24 18:15, 14F
推
06/25 00:45, , 15F
06/25 00:45, 15F
推
06/25 00:58, , 16F
06/25 00:58, 16F
推
06/25 01:07, , 17F
06/25 01:07, 17F
推
06/25 02:04, , 18F
06/25 02:04, 18F
→
06/25 02:06, , 19F
06/25 02:06, 19F
推
06/25 08:09, , 20F
06/25 08:09, 20F
※ 編輯: antirazin 來自: 125.226.177.91 (06/25 08:09)
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):