Data Structures Spectrum
Data Structures Spectrum
T H *gqr
:
= e
o w in g te
1 n l
f l
D e fin e th e o
n n s
B in a r y tr e e
(i)
F u b in a ry tr e
(i)
e te b in
p a ry tr e e
(ii ) C o m O
k U it4* 10 1
a fn v a r io u s r e p r e s e n ta tio n s o f b in a ry tr e e (R d
r W 1M q
02
d ta il a tx u t B in a r y T re e T r a v e rs a ORF= O it
E x p la in in e M q
03
b o u t T h re a d e d B in a r y T r e d T h re ds O lfe r u m
04
E x p la in a e s a n a
0 2 51
D is c uss th e p ro c e d To r m a in ta in in g th e h e p p ro p e r ty b r *
D e fir te h e a p u re a
OZ
05
bo t b in a ry s e a r c h tre e s a n d its h ig h t O
ok h it4 * r0 37 )
07 W rite b e y a u
e m e n t is s e a r c
a n e h e d in a B in a ry S e a rc h T re e ? E x p
a in (R e
er
n it N
W
Q8 How
in in d e ta il a b o u t g ra p h A D T IR a fe r U n it v IO l li
Q9 \
th e d iffe f g ra p h s IR e fe r V 10 12)
Q 10 W n a t is g ra p h ? D is c u ss re n t ty p e s o
to a in
t g ra p h s ? E x p e fe r
li
10 15}
Q 11 W h a t is g ra p h ? H o w re p re se n
h th o d s w ith ita b ex a m p
e r 116}
g ra p h s u e
E x p la in th e v a r io u s s e a rc m e
0 12
e r U V 10 19}
O
t by c o n n e c te d co m po n e n ts ? E x p
a in
0 13 W h a t is m e a n
IR o B r U M V l0 2 3)
D e lin e in im u m s pa n n in g tre e G iv e a n exa m p le
0 14 m
3
l
fr r
h o rte s t p a th g a tiv e dge s
Q 15 b e th e p ro c e s s fo r d e te rm in in g s no n ne e
IR e fr r U n h 10 3 2)
Q 16 E x p la in in b rie f a b o u p a irs s h o r te s t p a th p ro b le m
ta
0 9)
O a fr u m W
n s o r t in d e ta i
0 17 E x p la in th e co n c e p t b f in s r tio
(R e fr U n it V 10 )
12
rt in d e ta i
Q }8 E x p la in th e co nce p t o f q u ic k so
0 13)
W b r U a it W 1
Q 19 ; A n a f q u ic k s o rt,
y z e th e tim e co m p le x ity o
101
{R e r u n it V
Q 20 D is c u s s a b o u t th e i
s o t w ith a n e x a
m p
e
m e qg e - 0 18 )
(R fr r U n it V 1
Q 2 1 E x p la in in d e ta la b o u t ite ra tlv e m e rg e o r
0 20 )
U n it V
(R m
Q22 E x p la in b o u t h e a p o rt w ith a n e xa m p le 020
V l
a IR o E R U n i
he a p s o rti o n it
Q2i C o n s id e r lis t o f e le m e n ts a n d p e r fo rm v 0 22)
IR e fe r U n h
o f its
th e tim e com p le x ity
Q 24 W rit
e th e h e a p rt a lg o rith m
a n d d e riv e
so
*b re y o u b y
u
T L E
'
c Q V E P be
{a jA O U P LO G O
o n
. t H T
W ir e e it
#r * llN lH * itM
e 1ieli
(M e
r lR 0 l 4
D AT
sTl
tJCr
jRS
E H d
a r
(C o ti\ tn o n
\
3 \o
'im !l P tp l / tin V trU
e u ts
#
fN Y
t l i t
fh
rt tr }p e
Q le
p /i# i
rP pu oi
:
m
e \ lro t
/ ln s w
e lH l
tt t tie il H W t
l
l I ?
F t
pA R A ( tr k * 7
l M ) SO
t t
LIi
i
(a ) D e fin e
io n
(i) A b s trd c t
B*
a
b s tra c tio n
D a ta A
\ i
(b ) D e fin e Q ue ue
d p a th
D e fin e g ra p h an
f In s e N o n s o rt
w rite th e w o rk in g o
(
M IB T B ( M
- a rk 4 M 96 )
I C +
(a ) E x p la in in d e ta il a b o u t c la s s e s n
(b ) w h a t is a S pa rs e M a trl? G iv e th e A D T fo r S p a re e M a trix
(a '
Ia in h o w to p e rfo rm d if ie re n t o p e r a tio n s o n a e ln g le lin k e d ll* t
} : a in e p o in te r m
E )p an ip u la tio n In C + ,
(i) B in a ry tre e
O i) F u
b in a ry tre e
(iii) C o m e te b in
p a ry tr e e
(U n
tvo 1 3)
a in
Ex p v a r io u s re s e n ta tio n s f b in tre e
(b ) p re o a ry
(u n h n l 1o 1 0 1
(a ) w h a t is g r a p h ? D is c u ss th e d iffe re n t ty p e s o f G ra p h s (U n t V 10 12)
a in {h e
(b ) E x p v a r io u s g ra p h s e a rc h m ie th o d s w ith s u ita b
e e xa m p
e
nlt-v 1o 101
(a ) E x p la in theconcept o f g u ic k s o r t in d e ta i (
ln lt v10 2)
a in
(b ) E x p in d e ta ia b o u t ite ra tiv e m e r g e s o r t (
ln lt V l1o \a)
h W
4
T im J l Lo uM
Q '"tlop a p e r c o n # lM s o fP u n A an d pun B
A n s w e r in g th e qu e tio n In P a pt A co m p u la o r y
,
fo u r q u e lto n q B llo td b
u tr n g w e r e [ j>n m p a h B
PA R T A (M a r ks 7 2 - 4 )
n e A lT a y A b s tra c t D a ta T y p e s
(a ) O e f
\ i*
(b ) W n a t ls s ta c k ?
iq
W k
(c ) W h a t l8 s in g le lin k e d c lrc u ls ?
a r
!w[
(d ) E x p
a m th e fo llo w in g te rm s w ith re s p e c t to tre e s ,
m W h a t i8 th e p r in c ip le o f m e rg e s o r ?
(g ) W n a t is th e p rin c ip le o f q u ic k s o r ?
PAR ? B (M a r ks 4 M = 56 )
2 (a ) W rite a b o u t d a ta '
a b s tra c tio n a n d a tio
e nca ps u n
(b ) E x p la in h o w S p a re e M a trlc e e a r e M u ltip
ie d
3 (a ) W n a t a a ta c k ? E x la i
p n p rim itiv e
'
p e ra tio a ta c k
o
r o
(b ) E x p la in In d e
a ila b o u t e v a l
u a tio n o f e x p re e s lo n
4 fa ) E x p la in to w c h a n e lr p le m e n te d u s in g te m p la t is
(b } E x p fa ln h o w a * ta c k c a n be re p r e s e n te d ua
Ng lin k e d lla t
5 Fa ) E x p
a ln In d e ta la bo u t B
n a ry T re e T ra
v e ra a l
(b ) E x p la h a b o u t T h re a d e d B in
a r y T re e e an d T h re a d s ,
D A T A ST RU C T U R ES T H R O U G H C + + [J N T U K A K N A D
A )
Mp
h t ls m e a n t by c o n n e c te d co m po n e n ts ? E x p la in (u n it v Io 1 9 )
& (a ) W a
la in in d e ta il a b o u t g ra p h A D T (
ln lt V IO l li
(b ) E x p
la in th e c o n c e p t o f in s e r tio n s o r t in d e ta i Iu n lt v l Io 9)
7 (a ) E x p
is c u s s a bo u t th e m e r g e s o r t w ith a n e x a m p
e
(b ) D
:..
W \
P A r 5 L
l Y e a r S
e m e s te r E x a m in a t
o n
B Te c h
A O D E L P A P E R III
h s T R U C
T U R E S T H R O U G H C + +
D A T
(c o m m o n to C S E a n T
d )
M
T im 3 H o u rs
d P t B
e
e r c o n s is ts o fp a r t- A a n a r
Q u e s t io n pap
i
e s t o n ir P a rt A is c o m pu
s o ry
A n s w e r in g th e q u
tio n s s h o u ld b e a n s w ere d fr o m P a rt B
F r
o qu es
14 '
p s ir ioa
r A (M a rks 7 2 =
M tr ix ?
W h a t is a S pa rs e a
lin k e d lis t l\
in b r ie f a B o u t d o u b le J
D is c u ss
ic a tio n s o fqu e u e
L is t th e a pp
(C )
(U
ff n c e s b e tw e e
n T re e s a n
d B in a ry T re e s W I*
L is t th e d i e re
(d )
ls a lg o r ith m
' (ttitt\
a n d K ru k a
ti t b e tw e e n P r im s
(e ) D iffe re n a e
la te d? nln
f he a p s o r t is c a lc u
H e ffic ie n c y o
(f) o w
4110
rd tr a v e rs a
fo r in o e r
(g ) W r ite a n a g o r ith m
14 56 )
PA R T B ks 4 =
(M a r
for Po yn o m i al .
the AD T
po yn o m i a? Gi ve
a) w h a t is a
tio n s in C + + ?
ra
W h a t a r e th e s p e c ia l c la ss o pe
(b )
d in h e r ita nce in C + +
E x p la in a bo u ts u b ty p in g a n
(a ) u s in a lT a y a n a ;
n n e J . .. .
to im p le m e n t s ta c k A D T g
c + + p ro g ra m
(b ) w rite a
is ts
g lin k e d
o m ia u s in
D is c u s s h o w to re p re s e n t p o ly n
(a )
s e n ta tio n
D e fin e s p a rs e m a tr ix
A n d e x p la in its re p re
(b )
th e h e a p p ro p e y
rt
d u re fo r m a in ta in in g
(a ) D e fin e h e a p D is c u s s th e p ro c e
to p re se n t g ra p h ? E x p ia i
(b ) W h a t i g ra p h ? H ow re
m p le
E x p la iria b o it h e a p s o rt w ith a n exa
T
( )
f Q u ic k s o rt
(b ) A ria lyz e tb e lim e co m p le x ity o
:
D A TA ST RU C TU R ES TH R O U G H C + + U " TU KA K\
M o I
B Te c h U Y e a r S e m e s n a t io n
te r E x a m
M O D E L P A P E R V
D A T A S T R U C FU R E S T H R O U G H C + +
(C o m m o n to C S E a n d
T )
3H o ta s M ax M a
W 70
Q u e s tio n pa p e r c o n s is ts o fP a rt A a n d P a rt B
eri n g th e q te s tio n in p a n A is eb m p u ls o r y
F
e s li n s s llo ld b e a n s w e red P B
o a r \ u jm m a ri
(U it 0 5 )
n a t is a n in fix e x p r e s s io n ? G iv e a n e x a m p le { u
b) W
bo t p o ly n ia r e p re s e n ta tio (U n itll o 9 )
(c ) D is c u s s a u o m n
n a t a re th e d ie b e tw T re e a n d G ra ph? l
n it V
m o\
(e ) W re n c e s e e n
tci p e r fo re c u r s iv e m e s o rt U n it V I0 8 1
n W th e a g o rith h
rm rg e
D FS d B FS (U n it * 10 4 )
(S) D ifife re n tia te b e tw e e n a n
P A R T ,B (M a r ks 4 14 = 56 )
ln it 102 3)
l
s in M a trix
2 (a ) E x p la in th e co n ce p t b f T ra ns p g a
(U it I0 12}
d to in v o k e m e m be r fu n c tio n
(b) H o w o b je c ts a re use
10 10}
IU n IT
tin g c o n ta in e r c la s s e s
3 (a } D is c u s s a b o u t thi Js a g e o f te m a te s
p fo r re p re s e n
be
s s io n E x p la in h o w p o s tfix ex p re s io n ca n
(b) D e fin e in fix , re fix an d p o s tfix ex p re 10 20)
(U n it
e v a lu a te d
10 3 3)
(I' it4
4 ln k e d
bo u t c irc u
ar is t
(a ) w b rle ify a
na t is d o u b ly Iin k e d lis t? D is c u s s
\U n it
\ 10 3$)
lg o rl h m fo lis ts
(b) E x p
a ii a b o u t re c u r s lv e a r
o 391
v
(u n it
'
5 a in
h T re e ? E x p
(a ) H o w t i rc h e d In a B ln a ry S e a rc
an e
em e n s s e a 31
IU n it W 10
n d lts h e ig h .
t
(b)w H fe b i y s e a re h tre e s a
y o
b rie f u t n a r
o u b uy
L \I
th e T IT L E C O V E R b e fo r y
o n
lo g o
lo o k fo r th e d la @ u p
(U h
L
h ro b
o r te s t p a t p
e m
l p a ir s s h
ta
(b ) E x p la in in b rie f a b o u
a la t
\
a n d d e r iv e th e tim e co m p
e x ity o f its
lg o r ith m
w te th e h e s o rt a
,
7 (a ) a p
he s o r tin it
- kh*
d p e r fo rm a p g o n
e n ts a n
is t o f e le m
(b ) C o n s id e r a
(u
h,