You are on page 1of 6

JAGAN NATH GUPTA INSTITUTE OF ENGINEERING AND

TECHNOLOGY, SITAPURA, JAIPUR


Subject: D.S.A. Sem/
Branch: III Sem/C.S
UNIT-I
Q.1 (a) what do you undertand by com!"e#$ty o% a A"&or$thm'
(#!"a$n B$& )* )me&a and Theta Notat$on w$th (#am!"e.
[8 marks]RTU!"1#
(b) !ro+e that
($) %(n) ,-n
.
/ 0n / 1 $ 2(n
.
).
($$) %(n), 0n/. $ )(n). [8 marks]RTU!"11
Q.! (a) A 0 d$men$ona" array IN3) $ dec"ared u$n& IN3) (.:4*-
5:6* 1:67) and the no o% word !er memory ce"" $ 5.
3$nd the addre o% e"ement IN3) 8-*-6*49 :hen:
($) ("ement are tored $n ;ow major order.
($$) ("ement are tored $n co"umn major order.
Aume bae addre $ .77. . [1" marks]RTU
RE$AC%!"1#
(b) what do you undertand by .-D array 'how the .-D array $
re!reented $n memory'e#!"a$n . [8marks]RTUEC!"1!
Q.#(a) De<ne the com!uter a"&or$thm' what are the +ar$ou
charactert$c o% a"&or$thm' :hy $t $ d$=cu"t to et$mate the
e#ecut$on t$me o% a"&or$thm'how e#ecut$on t$me $ ca"cu"ate' .
[8marks]RTU!"1"
(b)wr$te an a"&or$thm to de"ete >th $tem %rom "$near array.
[8marks]RTUEC!"1!
Q.&(a) how can you ca"cu"ate addre %or 0-D array when array $
re!reented a row major order and co"umn major order'
[8marks]RTU'a(k!"1"
(b) what do you undertand by !are matr$# ' how how you can
con+ert !are
?atr$# $n to 0-co"umn %orm [8marks]RTU!"1"
UNIT-II
Q.) (a) :r$te an a"&or$thm to e+a"uate !ot<# e#!re$on .e#!"a$n
the each te! to e+a"uate the %o""ow$n& !ot<# e#!re$on
@: -* 0* /* 5* -* 4* . * /* A [8marks]RTU!"1!
(b) what do you mean by Bueue and deCueue' Decr$be "$n>ed
"$t re!reentat$on o% Bueue. [8marks]RTU'a(k!"11
Q.*(a) Dow to de<ne !r$or$ty Bueue' (#!"a$n one way and array
re!reentat$on o%
@r$or$ty Bueue [8marks]RTU!"11
(b)Dow tac> $ $ ue%u" $n %unct$on ca"" and return' :r$te an
a"&or$thm %or
;ecur$on. [8marks]RTU!"1"
Q.+ (a)how you can chec> end o% a c$rcu"ar Cueue u$n&:
($) Array re!reentat$on .
($$)"$n>ed "$t re!reentat$on
:r$te an a"&or$thm to de"ete Nth e"ement %rom %ront o% c$rcu"ar
Cueue.
[8marks]RTU!"1"
(b) e#!"a$n d$Eerent ty!e o% !ec$a" matr$ce. [8marks]RTU
EC!"1#
Q.8(a)wr$te the a"&or$thm %or con+ert$n& a $n<# e#!re$on $nto
!ot<# e#!re$on .e#!"a$n your a"&or$thm w$th e#am!"e. [8
marks]RTU'a(k!"1#
(b) C$rcu"ar Bueue $ to be $m!"emented u$n& a array o% 67
e"ement .:r$te the !eudo code %or $m!"ementat$on o% $nert$n&
an e"ement $n Cueue and chec>$n& whether Cueue $ em!ty or not
[8marks]RTU!"1#
UNIT-III
Q.,(a) wr$te an a"&or$thm %or de"et$on o% $ntermed$ate e"ement $n
a doub"y "$n>ed "$t w$th e#!"anat$on. [8marks]RTU!"1"
(b) F$+e the d$Eerence between array and "$n>ed "$t. how we
array re!reent the
G$near array $n array $n memory'
Q.1" (a)wr$te an a"&or$thm wh$ch remo+e <rt e"ement o% a "$t $t
to the end o% "$n>ed "$t w$thout chan&$n& $n%ormat$on !art.
[8marks]RTUr-'a(k!"1#
(b)what do you mean by earch$n& ' D$Eerent$ate between
eCuent$a" earch and b$nary earch w$th u$tab"e e#am!"e.
[8marks]RTU!"1"
Q.11 (#!"a$n the @uh and @o! o!erat$on o+er the tac> $% $t $
$m!"emented throu&h "$n> "$t. [1*marks]RTUEC!"1!
Q.1!. (a):r$te an a"&or$thm to add two !o"ynom$a" u$n& doub"y
"$n>ed "$t. [8marks]RTU!"1!
(b)wr$te an a"&or$thm %or add$n& and de"et$n& node %rom an
acend$n& order "$n>ed "$t. [8marks]RTU!"1!
UNIT-IH
Q.1# Su!!oe the %o""ow$n& eCuence "$t the node o% a b$nary
tree T $n @re- order and $n-order re!ect$+e"y.
@re-order: F B B A C I 3 @ D ( ; D
In-order: B B I C 3 A F @ ( D D ;
Draw the d$a&ram o% the tree T (e#!"a$n each te!) [1*marks]
RTUEC!"1!
Q.1& (a)what do you undertand by AHG Tree' (#!"a$n d$Eerent
rotat$on ued $n AHG Tree. Inert the %o""ow$n& e"ement $n AHG Tree
-7* 10* 1-* 1J* K6* K.* .77* 7* K* and 10 [8marks]RTU
!"1"
(b) what $ threaded b$nary tree and threaded b$nary tree data
tructure' Dow they are re!reented $n memory' (#!"a$n w$th
e#am!"e. [8marks]RTU!"1"
Q.1) (a):r$te an a"&or$thm %or de"et$n& a node %rom a b$nary
Search tree. Ta>e a"" !o$b"e cae. [8 marks]RTU!"1#
(b)what do you undertand by a"mot com!"ete b$nary tree and
b$nary earch tree' (#!"a$n w$th e#am!"e[8marks]RTU!"",
Q.1* Su!!oe the %o""ow$n& "$t o% number $ $nerted $nto em!ty
b$nary earch tree. Draw the %o""ow$n& b$nary earch tree
67* 64* 5* K* .7* -* 60* 4* 61* 6* 1* 6K
A"o <nd the he$&ht o% tree. [1*marks]RTUEC!"1!
UNIT-H
Q.1+ :r$te D$j>traL a"&or$thm. (#!"a$n $t w$th (#am!"e.
[1* marks]RTUr-'a(k!"1#
Q.18 (a) what $ d$Eerence between B3S and D3S A"&or$thm %or
&ra!h tra+era"
[8 marks]RTU'a(k
!"1#
(b) contruct a hea! D %rom &$+en "$t o% number:
55* 07* -7* ..* 17* --* KK * --
A"o ort the abo+e "$t u$n& hea! ort a"&or$thm. [8 marks]
RTUr-'a(k!"1#
Q.1, .a)what do you mean by &ra!h data tructure ' e#!"a$n the
eCuent$a" and "$n>ed "$t re!reentat$on o% &ra!h . [8 marks]
RTU!"1#
(b)wr$te hort note (any two)
($) ?$n$mum !ann$n& tree.
($$) Adjacency ?atr$#
($$$)to!o"o&$ca" ort [8 marks]RTU!"1!
Q.!"(a) Su!!oe the array A conta$n 65 e"ement a:
11* 00* 57* ..* --* 44* 17* 66* 47* .7* -7* 55* KK* 07
Sort the abo+e array a u$n& Bu$c> ort wr$te the +a"ue o% array A
a%ter each te!.
[8 marks]RTUr-'a(k!"1#
(b)how to de<ne ort$n& ' (#!"a$n $nterna" and e#terna" ort$n&
.A"o wr$te a"&or$thm %or bubb"e ort$n&. [!/#/# marks]RTU
!"11

You might also like