Insem Solution1
Insem Solution1
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
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
{
3.1 CE
{
67
x = x + i + j; 4
0:0
}
10
0:4
}
31
0/2 1
7
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
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
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
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