0% found this document useful (0 votes)
10 views

Insem Solution1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Insem Solution1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Total No. of Questions : 4] SEAT No.

P-5394 [Total No. of Pages : 2


[6186]-520

4
0:0
S.E. (Artificial Intelligence & Data Science/Computer

0:4
Engineering) (Insem.)

31
0/2 1
7
FUNDAMENTALS OF DATA STRUCTURES

02
8 1 38
(2019 Pattern) (Semester - III) (210242)
4.3 01
0/1
GP

Time : 1 Hour] [Max. Marks : 30


Instructions to the candidates:
3.1 CE
.18

1) Attempt questions Q1 or Q2, Q3 or Q4.


67

2) Draw neat & labelled diagrams wherever necessary.

4
0:0
3) Assume suitable data if necessary.
10

0:4
4) Figures to the right indicate full marks.
31
0/2 1
Q1) a) What is time complexity? Why asymptotic notations are important? Find
7
02
8 1 38

time complexity of following code using step count method. [6]


int x = 0;
4.3 01
0/1

for (i = 0; i <N; i++)


GP

{
3.1 CE

for (j = N; j > i; j--)


.18

{
67

x = x + i + j; 4
0:0

}
10

0:4

}
31
0/2 1
7

b) Write pseudocode to find factorial of a number. Draw the flowchart for


02
8 1 38

the same. [5]


4.3 01

c) Explain what is Linear and non-linear data structure with example. [4]
0/1
GP

OR
Q2) a) Write short note on : [6]
3.1 CE

ADT
.18

Divide and conquer method.


67

b) What is meant by time and space complexity? Explain the asymptotic


10

notations used for time complexity? [5]

P.T.O.
c) Explain what is static and dynamic data structure with example. [4]
Q3) a) What is Row Major and Column Major Representation? Explain with
example. Write the formula to find any element A[i][j] in row major and

4
0:0
column major representations of A. [6]

0:4
b) What is meant by sparse Matrix? Write an algorithm to perform addition

31
0/2 1
of two sparse matrices. [5]

7
02
8 1 38
c) Explain with example how single variable polynomial can be represented
using 1-D array? What is advantage and disadvantage of this
4.3 01
representation? 0/1 [4]
GP

OR
3.1 CE

Q4) a) What is the difference between simple and fast transpose of sparse matrix?
.18

Write an algorithm to find simple transpose of sparse matrix. [6]


67

4
0:0
b) Write an algorithm to find addition of two single variable polynomials
using array. Polynomial term consists of coefficient and exponent and
10

0:4
both are stored as an element in array. Assume terms are arranged in
31
0/2 1
descending order of exponent. State time complexity of the same. [5]
7
02
8 1 38

c) Draw and explain following terms : [4]


4.3 01
0/1

2D Array
GP

3D Array
3.1 CE
.18


67

4
0:0
10

0:4
31
0/2 1
7
02
8 1 38
4.3 01
0/1
3.1 CE
67
.18
GP
10

[6186]-520 2
Approach IterativeIn-place

Memory UsageRequires additional memory to


store the transposed matrixNo additional memory
required

PerformanceGenerally slower due to data copying


Faster due to in-place modifications

You might also like