ITPC12 ES 2019 May
ITPC12 ES 2019 May
The candidales, before starling to write the solution, should please d1eck the
question paper forany discrepancy, and also ensure that they have been delivered
the question paper of right course no. and subject title. Assume suitably and
state, additional data required, if any.
Note: Attempt any five questions and marks for every part of question are indicated
against of it.
r Q1.
I
Q2.
a.
An a-;:-ray of 10 clements, a[0:9], having values [4, 2, 6, 7,1, 0,r3+4
9, 8, 5, 3] is to be sorted using insertion sort
i. Draw a figure to show the progress of the sorting, for the above sequence of
input values.
n. Assume that a read vperation takes 1 unit of time, while a vaite operation takes
2 units of lime. What is the amount of time taken to complete the sorting? Explain
your reasoning used to compute the time taken. Also, explicitly mention any other
assumptions that you may need.
b. WAP in C language to find the last occurrence of a word in a 3
en strin &
a. Consider the following arithmetic expression P, written in 4
Postfix notation. Translate P, into its equivalent Infix Expression; evaluate the
infix expression using algorithm.
P:12,7,3,-,/,2,1,5, ,*,+
ROLL 'O.
The candidates, before starling to write Lhe solution, should please check the
question paper for any discrepancy, and also ensure that they have been delivered
the question paper of right course no. and subject title. Assume suitably and
state, additional data required, if any.
Note: Attempt any five questions and marks for every part of question are indicated
against of it.
3+4
3
_I
r
c. Writli an c1lgorithm to find hcther a
clement iI 4l-
I
I
Q3.
present or not in circular l]Ul'Ul'. What b the adv,1ntagl' ofl circular queue
Ovl'r a simpk� qucul�? I
p- q;
*p. 2;
l
int i = 0, j = 1;
int main()
{
f(&i, &j);
printf("11/4,d %d n", i, j);
getchar(); return O;
I I
b Assume that float takes 4 bytes, predict the output of following
I p"rogram and Pxplam it. 2
l I
float arr[S]:::{12.5, 10.0, 13.5, 90.5, 0.5};
float �ptrJ = &arr(0]; float ""ptr2 = ptrl + 3;
printf("%f ", "ptr2);
printf('"1od", ptr2- ptrl);
return O;
c. The clements 32, 15, 20,10, 12, 2c;, 16, 8. 10, 31 are inserted orwl
by one in the given order into a Max I feap. What will be the resultant Max
Heap and the number ofexchanges and also write
own the a!gorithm for Heapi_ry O and Build IJ..e ()?
a. WAl>inCprogram function to reverse every group ofk nodes
in a given double linked Ji-;t.
h. WAP in C' program to add two polynomial using:
1. DL�grel' based representation
5
2.5+2.5 I
I QS.
I
I
a. .a 4 I ;7 [
�: Ikl
uency
le: 5
I
I Q6.
/ ,
b.
Sho\,v the binary search tree that is obtained from after 5
in l'rtmg thL' key 8,11,.5,7,9,6,10,14,12. Red raw thetree after
dclL'tin_gthe root_.
a. Construct the Binary Tree using following Tree Traversal
c1lgorithms: 3
J n-order: 9, 8, 4, 2, 10, 5, 10, J, 6, 3, 13,12,7
Pre-order:], 2, 4, 8, 9, 5, 10, 10, 3, 6, 7, 12,13
b. WAP in C language to convert the conlt�nt of File to Uppercase. 3
_c. WA '2._C language to find the size of a BinaEl' free-. --- _4_ ,