Advanced Programming
Advanced Programming
Answer any TWO questions from GrouyA and THHEE questions from Group-B
GROUP-A
(b)
x 0.8 0.9 1.0 1.1 1.2
f(x) 0.71736 0.78333 0.84147 0.923L4 0.96356
L.2
Evaluate I f {*1a*
o.a
Use (a) Simpson's L/3 rule, @) Trapezoidal rule
[8+6]
2. (a) Using the following table evaluate Vt55 using Lagrange's interpolation
formula.
[7+7)
3. (a) dy/dx =11+y2), y(0) =0. Find y(0.6) using Runge-Kutta 4ft order method.
Choose Step size h =0.2.
(b) Solve the following set of equations using Gauss elimination technique.
4x1+31r-X:=-2
'2xt- 4xz + Sxg = 20
Xt*2xz+6xs=7
[6+B]
GROUP-B
4. (a) Explain redirection operator, pipe and filter of UNIX shell with suitable
illustration.
(b) Define "static" and "dynamic" binding. Write a C++ program to demonstrate
"late" binding. (5+9)
6. (a) Explain user defined data type in C/C++ using a suitable example.
(b) Write a C/C++ code to add naro mahices of compiex numbers, where real and
imaginary parts are expressed in rational form. (5+9)
(b) Write brief notes on: (t) gdb (ii) gnuplot (iii) gprof (5+9)
Answer any TWO questions from Group-A and THRXE questions from Group-B
Group-A
1. (a) The voltagev across a capacitor at time t seconds is given by the followilg
table. Use the pdnciple o{ least squares to fit a curve of the Joml v=aek to the data.
t (sec) 0 2 4 6
V (volts) 150 63 12 5.6
[7+71
2. (a) A rocket is Iaunched from the ground. Its acceleration, f is registered during the
fust B0 secs ard it is given ir the table below. Usitrg SiEpson,s U3'd rule, ftud &e
velocity of the rocket at t=80 se.s.
t secs 0 10 20 30 40 50 60 70 80
f: 30 31.63 35.47 37.75 40.33 46.69 40.67
crdsec2
3. (a) Using Newtor's Fomula fiDd {(22) and (42) using rhe following data:
x 20 25 30 40 45
f(x) 3S4 332 291 260 231 204
(b) dyldx = logr0 (x+y), y(0) =2. Srep size h =0.2. Find y(0.2) using Modified
Euter,s
method.
[B+6]
GROUP.B
4. (a) What is meant by developers' tool urder UNIX,4-INUX? Discuss about revision
contlol system and debugger of tools in a brief.
(b) How redirection opeEtors and pipes are used in UNIIVLINIJX? Give examples of
each g?es of operato$.
(c) What is clontab? Exaplain it in detail. (5+5+4)
dass TkoDPoiDt
{
public:
int x,yi
void setx(int a) { x=a; }
void setY(int a) { y=a; }
irt getx0 { retum x; }
i.nt getY0 { return y; }
):
Answer any TWO questions ftom GROTP-A and any THREE questions from GROUP-B
GROUP.A
(a) Use R-K 4th order method to solve the following equation.
.
;=,1, I t'0, = I . Find ) I0 . 2 , . Take srep size h =0. I.
2.(a) Find f(x) as a polynomial in x from the given data and then find f(8). Use Lagrange's
Interpolation techrique.
x 3 7 9 l0
f(x) 168 120 172 63
3. (a) Find the values of a, b, c so that Y=a+bc+cx2 is the best fit to the following data:
0 2 3 4
1 0 3 10 2l
l8+61
Page l of3
GROUP-B
4. Explain the purpose ofthe important functions and steps Lrsed in the following code
float fct(float x)
{
retum cos(x);
)
pi: acos(-1.0);
a=0.j
b=pi* t. /2.;
n = 100000;
dest:0;
ta:g = 123;
if (myid =:0) {
result: my_result;
Page 2 of3
for(i=l;i<p;i+r){
source = i;
MPlFinalizeQ;
]
float integral(float a, int n, float h)
{
int j;
float h2, aii, integ;
integ = 0.0;
h2=h t2.;
for (i= 0;j < n;j++) {
arj=afj*h;
integ += fct(aij + h2) * h;
)
.etum (integ);
o4)
5. (a) W te briqfnotes on redirection operators, pipe and filtereof UNIX shellprogram with
suitable examples.
(b) Discuss about development tool's under UNIX/LINUX. (6+8)
Page 3 of3
nglu'W
FIRST EALF
1. Determine the number of multiplications, divisions and fill-ins required for the LU
factorisation of mah-ix corresponding to the gaph shown in Fig-l. (11)
2- (a) write the [A] matrix corresponding to the gaph shown in Fig. 2. (2)
ft) Using Ordering scheme 1, re-order the matix and find out the number of fiIls that
will occur during LU factorisation of [A]. Clearly describe the interrnediate steps to
justify your answer. (9)
4- (a) What are the differences between parallel processing and dish-ibuted processing?
(s)
(b) Fourprocessors Pr, Pz, Pr and P+ hold 12 data as shown in column 2 of Table-1.
Explain how Odd-Even Transportation Sort algorithm can be used to sort the numbers
in ascending order so the processors finally hold the data as shown in the third colurrn
of the Table.
Table: 1
(o
(i) Process Scheduier, (ii) Inter Process Communication @C) Manager, (iii)
Scalabiiity and (iv) Portabiiity. (o
ft) Explain with a suitable example how a sparse matrix is stored in compact form
using Row Linked List technique. (5)
SECOND HALF
ar
V A w A W
1 220 0.14 4 54 0 0
trg -t
,2.
3 220 0.60 r28 s4 2.2 I 18.8
(5+2+4)
8. a) What is the difference between right join and selfjoin? Explain it with an example.
b) What's wrong in the following query?
D SELECT subject code, count (name)
FROM students;
ii) SELECT subject code, AVG (marks)
FROM students
WHERE AVG(marks)> 75
GROUP BY subject code;
c) Say True or False. Correct it if the answer is False: .
FIRST IIALF
O) Ushg causs Seidel method carry out 5 iterations to solve the Iollowing.
17 Xr + 65X, - 13 X3 + 50 Xa= 8a
12 Xl+ 16X' +37X3+18Xa=25
55Xr+23X, + 11X3 - 19Xa= 36
2. (a) Using power medrcd detemire the dominart eigeD value and con€sponding eigen vector
ofde Iolowing naEix [A].
Il0 -2 11
lAl=l-z Lo -zl
Ii 10l -2
(b) Find &e maEn [Dr] whose doEinant eigen value will be (he second dominant eigen value
of tAl- (7+4)
Page 1of 4
3. (a) In coNrection wili conculrent processing explain ihe following terms with the help of a
simple example.
(b) Explain how you would imPletnent Odd - Even transpo(ation sort algoriiim to arrange
the following numbers in ascending order.
7,3,6.s,A,1-,4,2 (4+7\
4. (a) Clearly explain the difference beMeen Parallel Processing and DisEibuted Protessing.
(i) Granularity, (ji) Overhead, (iii) Load Batancing, (iv) Socket, (v) I er Process
Communication (IPC) Manager (6+s)
5. (a) Fig. 1 shows &e gaph of an electric cAftit with 5 nodes (excluding the reference nod€).
Determine the degree of sparsity of the nodal admittance [laEix [A] of ihjs circuit
O) If [A] is to be factorised into a lower trlangular natrix [L] and an upper Eiangular loatrix
lul and their e]€nents are stored i! [Q] where [Q] = [L] + [U] - [I], where [I] is an identiry
matrix, determine the following
(c) Suggest a melhod to reduce the number of fill-ins; justiff your answer.
(2+s+2+2)
FiBure- r
Pag,e 2 o{ 4
SECOND ITALF
6. Explain the pupose of ttre important functions and steps used in ihe following code-
float fct(float x)
{
rerum cos(x);
i
float iltegral(float a, int 4 floath);
\pi = acosCl.0);
h=(b-a)/n;
my-range=(b-a)/P;
my_a : * my-range;
a + myid
Ey-result = htegral(my-a, Dum, h);
if (Eyid == 0) {
result = Ey-result;
Page 3 of4
) else
MPI-Send(&Ey_resU1t, 1, MPI-REAL, dest, tag, MPI-COMM-WORLD);
MPl_Finalizeo;
)
7. (a) what is RDBMS? How PRIMARY KEY and FOREIGN KEY are used? Explain witi suitable
example'
(b) Give an exaopie where a sub-query and a JoIN produce sa6e rcsull ((2+a) + 5)
8. (a) What is user defined function in SQL? write a small code segment aod €xplain it
(b) What is oigger? How a Eigg€r is different froo user defined fuction? Explain it with sLritable
example. (5+6)
9 (a) \ahy and how DNS and DHCP are used? ExPlain.
(c) wrire shon notes on: HTML, Serve. Site Scripting, CSS and digital signatrc.
(4+3+4)
c) Write the full form oI DDL, DML and DCL and give some examples of respective S QL
f?
{- v(nlt+
FIRST HALF
l. Two spame matrices A and B are stored in compact form using row linked list
technique as follows.
ForA:
A_row_starting
3 4 2 5 7
A value
2 3 I 7 4 2 6
A col no
4lr 4 3 3 2 2
A link
0 0 6 0 I 0 0
For B:
B_row_starting
2 5 7 I
B value
7 6 9 3 J 5 2
B col no
3 4 J 5 5 I 2
7
B link
4 6 0 0 0 0 3
(i) Obtain C = A.B and express it in compact form using row linked list
technique. (8)
(ii) Determine the number of mathematical operations that could be saved by this
technique instead of storing the matrices in conventional method. (3)
(ii) Find the dominant eigen value and corresponding eigen vector of the
following matrix by Power method.
1 I J
1 5 1
J 1 1
0
0
I
(s)
(iii) Find the next dominant eigen value and the coresponding eigen vector by
Shifting technique. (4)
3 (i) Explain (a) speed-up and (b) efficiency in connection with parallel processing
(4)
(ii) Suppose the numbers 14, 6, 12,70,16,2,8,4 are held by eight processors Ps,
Pz, ....., P8 connected linearly. Explain how Odd Even Transportation,Sorf can be
used to arrange these numbers in ascending order so that smallest number is in
Pr, the second smallest is in Pz and so on. (7)
(ii) Which Operating System components perform (a) write to disk, (b) determine
which process will run next, (c) determine where in memory a new process
should be placed, and (d) organise files on disk. (2)
2
(iii) What is the difference between a program and a process? Draw a diagram
showing different process states and transition from one to another. (4)
(ii) Explain (a) Inter-process Communication, (b) Message switching, (c) Packet
switching. (6)
SECOND HALF
6. (a) What is sub-query? How IN and NOT IN clauses are used in SQL queries?
(2+s)
(b) Write brief notes on the following SQL commands/clause with appropriate
examples
7. (a) What is RDBMS? How PRIMARY KEY and FOREIGN KEY are used?
Explain with suitable examples. (2+4)
(b) Give an example where a sub-query and a JOIN produce ru*. r.rrr,.
,r,
8. (a) What is user defined function in SQL? Write a small code segment and explain
it. (s)
(b) What is trigger? How a trigger is different from user defined function - explain
it with suitable example. (6)
9. (a) What are full forms of DNS and DHCP? Explain the DNS and DHCP services
(2+s)