作者antirazin (今年是日星来台年~真嗨)
看板TransCSI
标题[问题] 一堆问题...没办法..考试快到了咩(茶)
时间Sun Jun 24 10:31:59 2007
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
1F:推 ahongyeh:第五题~~我不聪明~~所以我不会~~ 06/24 11:36
2F:推 abien:5.(1)电脑是2^10才进一个单位1mb=1024kb,而windows显示是 06/24 12:23
3F:→ abien: 1mb=1000kb。 06/24 12:25
4F:→ abien: (2)请亲自划分磁区,就知为何 06/24 12:26
5F:→ abien:有错请指教,这只是我的印象,怕误导版众 06/24 12:27
6F:→ abien:(1)的讲法好像错了,应该是(2)才对 囧 06/24 12:29
7F:推 biox:应该说,正确厂商来说是以1000为单位作计算,而非1024 06/24 17:06
8F:→ biox:以DVD光碟片来说4.7GB实际上是4.7*1000^3/1024^3 = 4.3GB 06/24 17:06
9F:→ biox:因为厂商为了计算方便 以1000做单位,但是电脑用1024 06/24 17:10
10F:→ biox:才会造成误差~ 有错请指教。 06/24 17:11
11F:推 abien:楼上说的有可能.但是划分磁区需要消耗一些空间给设定档, 06/24 18:09
12F:→ abien:所以windows显示磁碟空间才不到200mb 06/24 18:10
13F:推 abien:我家DVD空白片是4.7GB用OS看只有4.5GB XD 06/24 18:15
14F:→ abien:总之这都能解释吧...大家都很聪明^_< 06/24 18:15
15F:推 x0315b100:显然在计概板比微积分版安详许多~"~ 06/25 00:45
16F:推 ahongyeh:搂上感触很深!? XD 也许大家最近心情比较烦燥吧... 06/25 00:58
17F:推 biox:真的,期末适逢有些学校已经开始招考 So,..... 06/25 01:07
18F:推 dgf130:第四题:应该是j<n 06/25 02:04
19F:→ dgf130:好像很多93联大的题目XD 06/25 02:06
20F:推 antirazin:啊打错~ 06/25 08:09
※ 编辑: antirazin 来自: 125.226.177.91 (06/25 08:09)