Algorithm
Algorithm
8s Total Pages : 4
Third Semester
Computer Science & Engineering/IT
Scheme OCBC July 2022
ALGORITTIMS
Time : Three Hours Maximum Marks : 70
Note :I Atternpttotalsxquestions. QuestionNo. I (Objectivetype) is
compulsory. From*re ranaining questions attempt Ntyfwe.
gf, E: qen 6f, frfrqr qaq mqi6 I (T€ftg rflI oT)
qM, tr tq qqii { t fr-€f qiq o} Ea 6ftqr
0 In case of any doubt or dispute, the English version question
shouldbe treated as final.
ftffi $ s-n'n h rik 3Ter{r fi-{rq fi Rifr it GiM qrqr b
qai +i Gifrq HTr qrimr
Ft2023t7485 P.T.O.
121
2. a) Whatisthetimecomplexityofanalgorithm?, 2
q6 \F,rilfuqq fr er{q EFIQBHA rqr ta
b) Define stack. Write applications ofstack. 4
e6 oi qfurR-d fiftqr e6 fr sqqift-dT ftfuqr
c) Whatis setsandmultisets?Explainwith example. 6
+c afu Tdte aqr tz sqrd{ul wFo wqsrgqr
3. a) Whataretheadvantagesanddisadvantagesofbubblesort? 2
T{d qfC h anr dt{ 6ftqf eqr ta
b) Explainhowmergesortworkswithexample? 4
,r$ qfC Ad oTd oror t r{flq sFo srsrEqr
c) Write an algorithmto implement selection sort. 6
Rdqqlq qiC o1 Ediic o{i } ftq q-dilR?rq ftfuqr
Ft2023t748s Contd.....
t3l
4. a) Whatishashtable? 2
ter ti-d rqr t?
b) What are the advantages of balanced search tree? 4
d-i{-s q-d * }'eqr drtr t?
c) Consider a l0 slots the following keys are inserted
hash table wittr
in the order 34, 16,2,93, 80, 77, 51. The hash function is
h(k) : kmodl0. What will be the hash table? 6
10 Ffd fr go teT t{d dfrqr ftq keys o\ qs mq ii srfrq
34, I 6, 2, 93, 80, 7 7, 5 1 tqr qtq{rt h(k) : kmodl 0 t, tqr &f,
Tqr dlrn?
5. a) WhatisGraph?Definepathalso. 2
qTs'qrqt tf qrq 6) tfr qfu+rfrd fiftqr
b) example. 4
Describe directed andundirected graph with
slqHs eflc an-r-slqHs ilE fr vEr{tur qFo qrsr fifrqr
c) Explainflow-basedalgorithm 6
d-+€ gdilRqq o1 q=rs{r{qr
6. a) Define lossy and lossless compression. 2
EiS Gfu ffi{T o-d$q o} qffid fifrqr
b) How a substring is searched in a sting? 4
\tr &q { t rq qqBr trt'qai te
c) Writeanalgorithmtoreverse sting " 6
qo ffi d q-dei h frq \-dilRem ftfuqr
7. a) Definequeue. 2
qot qfuirfr-d ffirqr
b) Explainbinarysearchteewithexample. 4
qrfl-S Hd *
oi s<rdqur sFo s{sr{qr
c) Sort the following arrayusing bubble sort. Show each step. 6
44,11,99,33,55,99,22
qe-n qfd ERr ftq tt o1 efC fifrqr q*ft qrit oi EeTHr
44, II,99,33,55,99,22
Ft2023t7485 P.TO.
t4l
8. Writeshortnoteonanytwoofthefollowing. 12
, Programmingmodels
0 Symboltable
O Minimumspanningteealgori*rm
iv) Regularexpression
ft'q iT t
m-6 d qr dfhg ftHUft fttuqr
D MqTr qfrffi
D ftEid tq-d
- a\.A!&
Ft2023t7485