作者devilsatoshi (幼稚鬼)
看板TransCSI
标题Re: [问题] 元智91年的转学考考古题
时间Mon May 28 15:16:13 2007
※ 引述《sss955212 (灵魂的缺角)》之铭言:
: 1. Consider the following procedure.If the argument n is 5,what will the
: procedure return?
: procedure SUM(n:integer)
: {if n=1
: return(0)
: else
: return(SUM(n-1)+n*(n-1))
: }
: 答案是 24 吗??
SUM5=SUM4+5*4
SUM4=SUM3+4*3
SUM3=SUM2+3*2
SUM2=SUM1+2*1
SUM1=0
所以应该会RETURN 20+12+6+2=40吧?
我是算这样耶 不知道对不对
: 2.Show that if xy=0,then x⊕y=x+y.
: 什麽是⊕??
x⊕y=xy'+x'y
=x(1-y)+(1-x)y
=x-xy+y-xy (xy=0)
=x+y 得证
: 3. Sort the following elements of the memory hierarchy interm of access speed.
: (a)Main memory (b)Harddisk (c)L1 Cache (d)Network (e)CPU registers
: (f)L2 Cache
: 答案:ecfabd Network是memory吗?
速度:暂存器(register)>快取记忆体(cathe)>主记忆体(main memory)
又硬体包含上述这些东西 所以硬体的速度会更慢 ,同理网路会是最慢的
希望有帮上忙^^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.113.168.178
※ 编辑: devilsatoshi 来自: 59.113.168.178 (05/28 15:18)