QP 2023
QP 2023
Va) Given a string m, write an algorithm to find the length of the string, and finding a
substring oflength k (which is less than m) in the string.
~ What is well defined recursion? Write a recursive algorithm to find GCD of m, n
f' V Trace your algorithm to find GCD of numbers 1124 and 22. o/ (7+7)
S. @ /sort the elements {8, 6, 3, 4, 2, 7, 5, 0, 1, 9} using merge sort algorithm. Write the
/ algorithm. What is the complexity (time) of your algorithm.
}S» Write an algorithm to find the k th smallest element in ~ay. (7 +7)
[P.T.O.
-.. u , c . . , t'JO Ur.s
l11w
'
r,I C,1IOI/\'
• fo ,. ,. . . , . ,
n
(2) 708 03
11111111111111111111111111111111111
n.
Trace your algo rithm to remove duplicates
6. " '1ite an aJg01i tlu11 to remo ve duplicritcs from a list.
from the foJiowing list {I , 3, 3, 4, 5, 6, 6, 6, 7, 8,
8} /1 (1 4)
-~ / I
I) ~
J
/ I; ~J
\.)
I
\ r
\ ll '
0
~ 4
I
}
/
.?
1'i'
'. ( 2..
l ·\ ' r' l- \ ., .,
2 2,
•1- ? ·f I ~c ,J ':" bl
'1 ~.:J
;, .-l
4ti ) bf )
I
31 ' ':. t/
\ ~ tf
( i 1J (
)
~
·-
\
.,.. r
11111/IWllllliUl~I111111 70804
c) Calculate the number of comparisons required to match the given pattern using Boyer
Moore algorithm
Text: 00010001010001
6 2 3 + - 3 82/ + *2 /\ 3+
(2+6+6)
3. a) Solve Tower of Hanoi problem where munber of disks n=3. Also write algorith m for
the same.
i) Binary tree
[P.T.O.
( ' nn1p11fcr· A •""tli't
' l'c:f II r·c
(CIJCS "dH•nu• \ ' 2K21)
Pnp,•r • l\tL' r "
·, ·;,.,,, : l ''•HI,.
ark!
()}
70804
llrn 11111 111111111111111 11111111
I
11) lk1pht 11t ;1 tier
b) Construct anAVL tree by inserting the following clements in the given r,rdcr
(5 + '))
63, 9, 19, 27, 18, 108, 99, 81
6. a) Write the algoritlun for selection sort and trace it for the following values:
7. a) Create a BST for the numbers 8, 3, 10, 1, 6, 14, 4, 7, 13. Also transfer the BST lnorder.
Preorder and postorder.
b) Find the shortest distance from source vertex 'S' to remaining vertices in the following
graph using Dijkstra's algorithm. ( 6+8)
t. (7)
3. a) Discuss the phas es of instruction cycle with a neat flow char
(7)
b) Explain mem ory reference instructions
(8)
5. a) Write a note on arithmetic and shift instructions.
(6)
b) Differentiate between RISC and CISC.
{P.T.O.
- ,., ' Yl o
Urtccn lllark .
s.
I s,, m,•id,,,, M .S,·. l> q! t ,,,, l•. ~11 tnin:11 ion . 1\b,y - 2'12 \
f OMl'l l' l lf, H '-t ( 11•, f'. f L
PJ nhlt•na ~ol vlug r._,, huiq,u·
(<'B( 'S Sc-hnn,•) (Y 2 1<2 1)
Pnpt·t· : MSC '- I OlT
Tim<-' : J 1lo1u-s M,rximu m M~rks: 7()
Instructions to c,uulidares:
I) Answer any Five full questi ons.
2) All quest.i ons carry fou1ieen marks.
1. a) What do you mean by best, worst and average case compJexjty of an algon•.brn? Find
the worst case complexity of linear search algorithm. (8)
b) Write an algorithm and flowchart to find the nth fibonacci number. (6)
2. a) Using suitable example, explain the relation between pointers and arrays. (5J
b) Trace and sort the following list of numbers using quick sort:
b) Write the algorithm for text line editing. Explain with an example. (7)
4. a) Write an algorithm to find smallest divisor of an integer. Trace the algorithm to find
the smallest divisor of 45. (7)
b) Sort the list of elements 9, 16, 32, 8, 41 , 5, 80 using heap sort. (7)
I
5. a) Write an algorithm to compute prime factors of an integer. Trace the algorithm to find
the prime factors of 1092. (8)
[P.T.O.
• Cc h'-'
~)
b)
(2) 70803
111111111111 111,111111 rrirr 11111111
FxfJ loin the Ji11c111 pn1lcr n s c: 11 c hrr, g a Igor ilhm with an cx;11npl c. (7) 0
6. n)
vVnt c nn olgori1l1111 :ind llo wc hni l to f 111d th c , t·vc, -.co l ,in inti.;gcr. Trace the algorithm
h)
to find the reverse or 7lZ'"> . (7)
Write a C program us ing s~itch Slat crncnt lo calculate th e grade of a student, given
7. a) 1
·ks of 5 s ubjects as mput.
t I1e mar
GradeA
90-100
GradeB
70-89
40-69 GradeC
riml' ; J Hours
1n,rmctio11,, ro ca1Hlidate.,:
,\ns\\ er any Fh c full questions. Cach question ca1 ries 14 marks.
(7}
Explain the different services provided by the operating 5y~tem .
l. a)
What do you mean by a system call? What are the different types of system calls1(7)
b)
1. Virus
(8)
11. Worms
{P.T.O.
(CBCS Sc heme)
Paper: MSClO l T
b) Explain the various methods which enable to reco ve r from dead locks. (6)
7
· a) What is a deadlock? Briefly describe the various methods of deadlock prevention(S)
b) What is a security attack? What are the different types of security attacks? (6 )
8. a) Write short notes on
1. Segmentation
b) Explain the shortest seek - time - first disk scheduling algorithm. (6)
r 70801
1111 fll lMl'II IWIIII1ll1
,, J ,t t i l l \ LJ
t ,:, 111111,11in11 . ,f 1111l / lli l\ 2022
I :-,,• 11 H ,It I '\ 1. ...., 1,. lkJ" 1, 1,
b) Sirnpli I)' Lhe !'ollowing Boolean Ji.met.ions F (W.X.Y.,Z)= I (0, L 2. 4. 5, 7. 8. 10, 11. 15 ).
(5)
c) Whal are the differences between half adder and full adder. (5)
2. a) Subtract 85 ( 101 from 36 ( 10 1 using 2's complement method with an example. (8)
J. a) What is control unit? Explain in detail Hard wired and Micro prognnmed control
unit. (8)
b) What is Logic Microoperations? Write list and hardware implementation of Logic
shift Micrnoperaiions. (6)
4. a) What do you mean by register transfer language? Discuss with lhe help of suitable
example:, \ arious register transfer operation. (8)
b) Explain data l-hwucl s in ILP. (6)
(P.T.O.
/!/1" rn Iii/I 1fU lllil Iii 1111 70801
s. :1 ) l)t.t\\ 111~- llu\\ 1·'1:111 iii i1 1s l1111.:ticrn L')rk :tlld cxpl:1i11 111 d1·1:iil . (k)
b) \\ 1 ,,~, ,1 JH'll' 1111 i11•,1111L'lin11 lorrn:il. ( (j)
7. a) Perf<.)rm l~ncoding ul data bits 001 1 into 7-bit even parity hamming code. (8)
b) Explain DfvL\ L'<JlllrolJer vvi1h a neat diagram. (6)
8. a) What is PRAM'! E:\plain the four Memory updates or PRAM and variants. (7)
b) What i~ sequential and Weak Consistency model ? EAplain Sequential consistency
in detail \\·ilh neat diagram. (7)
1111m 1111111111111111111111111111 70802
2. a) What is critical section problem? Explain with general structure and write its
requirements?
(7+7=14)
(7+7=14)
4. a) What is deadlock? Discuss necessary & sufficient condition for a dead lock to happen
(7+7=14
(P.T.
( 1.)
11111IIM 1111111111111111111111 70802
5. :i) \\ h,1( i.s .scc111 ,1, 111 n1w1 al i 11 g syi, 11•111 1/ \V, i1,· ~1ny f 0111 gq;ds rd prritcc tion'!
6. ,l) I •,pl:1111 k:i.st I ccc111ly 11snl 111c11101 y p:i gc I c.:p lrKClllClll ,ilgr,ri th rn .
(7 '-7= 14)
b) A disk driv~ has 200 cylinders, numbered 0 to 199. The drive is currently ~erving a
request at cylinder 53. The queue of pending requests, in SSTF order, is
98,183,37,122,14,124,65,67. Starting from the current head position, what is the total
distance the disk ann moves to satisfy all pending request for the above algorithm?
(7+7=14)
8. a) What is a page, a frame? a page table? Discuss the difference between paged memory
& segmentation memory.
(7+7=14)