Professional Documents
Culture Documents
07
C o n ıp u te r S c ie n c e / I n fo r m a tio n T ec hn o ı
o gy
T IM E : 3 H O U R S 107008 6
M A X M /【
U M M A RK S : 300
IN S T R U C T I O N S
S e c tio A to S e c tio n D
g ll e s tio n paper m a y b e d iv id e d in to 4 (fo u r ) S e c tio n s Tro m n
a n d c a r r y m a r ks a s u n de r
(a ) d (b ) ea c h
p a r ts i e
a n
S e c tio n A T o ta l 3 g u e s tio n s h a v in g tw o
T o ta l 3 6 M a r ks
12 m a r k s x 3 g u e s tio n s
-
qu es tio n s c a r r ie s
i e (a ) a n d (b ) e cıc h
s ec tio n B T o icï ı3 gu es tio n s h a v in g t w o p a r ts ,
20 m a r ks 3 g u e s tio n s
- T o ta l 6 0 M a r k s
q tte s tio n s c a r r ie s x
(a ) d (b ) ea c h
s ec t io n C T o tcï ı3 g ıłe s lio n s h a v in g tw o p a r ts i e a n
3 g ıt e s tio n s T o ta ı8 4 M a r ks
e s tio n s c a r r ie s 28 m a r ks x
qu
d (b ) ea ch
S e c tio n D T o ta l 3 g u e s tio n s h a v in g tw o p a r ts i e (a ) a n
40 a r k s x 3 g u e s tio n s
- T o ta ı1 2 0 M a r k s
q īłe s tio n s c a r r ie s m
S E C T IO N A
f6 a rk s e a c h)
h qu e s tio n is f 12 m a rk s a n d eac h su b part (a ) a n d (b ) a r e o m
(E ac o
d de
n n in g tim e o f th e fo llo w in g p s e u o
co
\ D e s c r ib e th e w o r s t c a s e r u
ń ın c ū on s in B ig O h n o ta tio n in te r m s o f th e v a r ia b le n
v o id s illy (in t n ){
if (n < = o ) return
S y s te m o u t p r in tln (n
"
.
"
+ n ) ,
tio n s
(b ) Su p p o se a w e b s e rv e r has 10 o n g o in g T C P c o n n ec
s id e s o c k e ts a r e u sed? H o w m an y s e r v e r s id e
H o w m a n y se rv e F
d?
po rt n m b ers are u se
Scanned by CamScanner
F ' "
' "
1 b §lic c e s s fu lly p r e v e n t s ū om c a u s in g da m a g e to
u ser p r o g ra m
o ū cr p «o g ra m s o r th e O S h a rd w are su pp o rt is re q u ir e «L N am e
tw o ware m e c han is ın s in m o de m C PU s th a t s u p p o r ts th is
g o an d fo r ea c h on e d e s c r ib e w h a t s p e c ific kin d (s ) o f d a m age
į t p « e v e n ts
(b ) T V】
ia t is 1l e s iz e o f a T C P h e a de r ? W n at is th e s iz e o f a U D P
ıie a d e r ? W n at fıe ld s e x is t in b o th T C P h e a d e r an d U D P he a de r?
3 (a ) D e s c r ib e on e a dv a n ta ge an d on e d is a d v a n ta g e c ir c u it s w itc h e d
n e tw o r k s ha v e o v er a packet sw itc h e d n e tw o r k s
(b ) W n a t is th e ın in im u m an d m a x im u m n um ber o fn o d e s in a R e r fe c t
b in a ıy tr e e o f h e ig h t h
S E C T IO N B
4 (a ) D ra w th e b in a r y m in h e a p th a t re s u lts f ro m in s e r tin g 9 3 2 6
8 4 1 in th a t rd e r in to in itia lly
o an em p ty b in a ry m in h e a p
@) D e s c r ib e th e m e c h a n is m o f p r io r ity in h e r ita n ce an d g iv e an
ex am p le o f th e la n d o f p r o b le m iť s in te n d e d to s o lv e
In th e sc h e d u le s g iv en b e lo w a b e 1 R jÆ in d ic a te s a r e a d o f
th e ı
eı
em en t X b y lr a n sa c ū o n Ti a iıd w iÆ in d ic a te s a w ū t e o f e l e n ıe
X b y tr a n s a c tio n Ti D ra w th e p r e c e d e n c e g r a p h fo r th e sche d u le
F in d t h e 】
a n g u a g e g e ııe r a te d b
y th e fo llo w in g g r a m m ar
s h o w n b e lo w
\ 1傘 1吕 @ ) r t\ r( )
Þ鼻 S r 2 (a ) r r (c ) r 2 (b ) r ĵ (b ) w 2
r 3 (c )w 3 (c ) w a
Is th e s c h e d u le co n flic t s e ń a liz a b le ? If so w ha t o rd e r o f d re
b p s §* te u ite llį ik h a ś
l a p r o p a g a tio n d e la y o f 400 W T he
th r e e t ra n s a c tio n s d e fin es a con flic t e q u iv a ı
en t s e r ia ıs c h e d u le ł
e xn 耻 ty s 1h c ŝ back n A R Q sc h e m e w ith . se t to
S e a r c h tr e e th a t
D raw th e B in a ry re s u lts Ĥ o m is seţ ţ i]s g th e M
a in e ¢ą c h Ĥ a n ıe js 1 0 0 b y te s lo n g w h a t is th e m m im um
3 a ļ , ĝį §
āł Th a ţ o r d im an idi tia em ?
21 [C o n td 3
Scanned by CamScanner
o g ra m A u s in g k e m e t th r e a d s Y o u th e n r e r u lı 11 u s i g
{d ) iY « iu m p
n
d a ta s tr u c tu r e Fo r ea c h o p t io n u se th e a v e ra g e c a s e bi tim ë
u s įr u e v e l ū iī c a d s H o w c o u ld th e s e tw o r u n s b e h a v e d iffėr e n d y
com p le x ity r e su lts of e a c h d a ta ıc tu r e to
s tr ı d e te r ın in e 1h 0 ċ ò s ts
m f le s p e c t to lo a d an d s to r e in s tr u c tio n s ?
S in
a s s o c ia te d w ith th a t ? ta s tr u c tu r e ĵ n th is s itu a tio n ce you
in im a l D F A th a t ll b in b e rs w h e re kn how
n sı
ru c t a m a c c e p ts a a ry n u m o w e x a c tly how m a iı
y e le m e n ts are store a iıd m an y
ė a c lı b in a ıy Jn ıb e r
n ı is d iv is ib le b y 3 searche s m u st be perf orme th e c o s t v a lu e s s h o u ld b e n u m bers
n o t ex p r e s s e d in te r m s o fN B a se d o n yo u r an a ly s is w h ic h o f
th e d a ta s tr u c tu r e s w o u ld b e th e w o r st c h o ic e in th e g iv en
9 (a ) A m ic r o p r o c e s s o r h ? a 2 4 b it a d d r e s s lin e W e co n n ec t a m e m o ry
s itu a tio n ?
c h ip to th e m ic r o p ro c e sso r T he m e m o ry c h ip a d? esses a re
a s s ig n e d th e ra n g e O × 8 0 0 0 0 0 to O × W n a t is th e m in im u m
e m o r y c h ip ? Expı
a in y o du re lts in 1 if f th e l l
i e e m e n ts e v a u a te to
m u r pro ce w
2 w re su m o re o w
n
is ca lle d a M j
a o r ity te r m F u r th e r A M j
a o r iy ex p r e s s io n is a
2
T (n ) 2T (n /2 ) + n
M a jo r ity te r m th e in d iv id u a l e le m e n ts o f w h ic h m a be
y
M a jo r it y te rm s o r M a jo r ity e x p r e s s io n s E x am p le
< a b< x yz» c< p q» r s t» > C an a M a o j ń ty te rm be ex p re ss e d as a
S E C T IO N D
re gu la r ex p r e s s io n ? If so h o w ? If n o \ p r o v e A ls o d o e s M a o j ń ty
(E a c h q u e s tio n is o f 40 m a rk s a n d eac h su b p a rt (a ) a n d (b ) a r e o f 20 m a rk s e a c h )
E x p r e s s io n fo r m a co n te x t fr e e la n g u a g e ? If so h o w ? 1f n o \
p ro v e
10 (a ) Y o u are d e v e lo p in g a ]a ıg e p r o g r a m an d n ee d a su b ro u ń n e to (b ) C o n s id e r th e n e tw o r k s sh o w n in th e fig u re b e lo w A s su m e
s id e d e la y f is 2 ds
p r o b le m to o b ta in th e o p tim a l s o lu ń o n o a re qu e st se c o n U s in g M /】
W 1 qu eu e to
m o d e l th e a c c e ss d e la y in th e 1 5 M b p s a c c e ss lin k T h e fo r m u la
@) U se a g r e e d y a lg o r ith m th a t p r o v id e s n ear o p tim a l s o lu ń o n s
fo r th e a v e r a g e r e s p o n s e t im e is E [T ] 1/(p k) h e r e À is th e
fo r m o st c a se s W ı
ıic h o p tio n w o u ld y o u u se in y o u r
w
)£s
im p le m e n ta tio Ą u n de r w hat c ir c u m s ta n c e s an d w hy ? a rr iv a l r a te o f o b je c ts to th e a c c e ss lin k an d p is th e s e r v ic e r a te
f th e lin k
(b ) ti m u st k e e p tr a c k o f so m e d a ta Y o ur o p tio n s are
o ac c ess
a B iııu y s e a r c h tr e e o f r e c o rd s (a s s u m e it is w e ll b a la n ce d)
ie th a t y q u m u st fir s t b u ild a d a ta s tr u c tu r e h o ld in g 2 ıo
ıe ı
w ı ıts a iid ih e nıy ou m m t p e r fo r m 2 20 se a rc h e s o n th a t
4 107 l )
[C o n td
Scanned by CamScanner
(b ) T h e fo llo w in g u e s tio n s d l
q ea w ith c R c e rr o r d e te c tinlf c o d é
(i) G iv e n a m e s s a ge M 10 10 0 0 1 10 1 d e te ī m in e th e CR C
u s in g th e p o ly n om ia l p 5 + 4 + 2 + I Sho w r work
x x x you
ş\
p EXg .
on w h a t is th e tr a n sm itte d m e ssa ge ?
(iii) H ow d o e s th e r e c e iv e r c h e c k w h e th e r th e m e s sa ge T w t is
tr a n s m itte d w ith o u t an e rr o r s ?
y
in
n o ı
W 1 qu
in g th e M /】 fo r m la to c a lc u la te th e d e la y
is u s e d a s su m eu e u
]f th e h it r a te fo r th e c a che is 0 8 iĵ n d th e to ta l a v e ra g e re sp o n se
th a t y o u ha v e f le n g th N c o n s is ń n g o f
(a ) u pp o se an a rra y o
ipĖcation s o f th e s tr in g B B B A F or ex am p le b e lo w is th e a rra y
fo r N 16 fo u r r e p lic a ū o n s o f BB B A
s e le c tio n so rt m a k e s o r t th e
($) Jļ o w m an y co m pa re s d o es to
a rr a y a s a fiu ıc tio n o f N ?
@ ) H ow ın a ıry co m p a r e s d o e s in s e r tio n s o r t m a k e to s o r t th e
H ow ın a w w pu e s do e s m e r g e s o r t m a k e to s o r t th e a m y
as a m c ū o n ,o fN ?
U
10 7 1 ?
Scanned by CamScanner