You are on page 1of 1

D9

7
0E

95

CB
CE
Paper / Subject Code: 49373 / Data Structure

1C
B5

30
94
1T01873 - S.E. Computer Science & Engineering (Artificial Intelligence & Machine Learning) (R-2019) SEMESTER - III / 49373 - Data

D9
55
0E

B
CE
D8
Structure

1C
09

9C
B5
94
1F

E3
QP CODE: 10012055 DATE: 25/11/2022

55

D
CE
8
FA

1C
0

9
D

B5

0
94
(3 Hours) Total Marks: 80

1F

55
72

E
CE
D8
FA

50

9
0F

30
94
1F
N.B: (1) Question No. 1 is compulsory.

B
30

95
7

CE
8
FA
B7

50
F
(2) Attempt any three questions out of the remaining five questions.

FD

30
0

94

EB
0
9C

72
(3) Figures to the right indicate full marks.

A1

E
3

8
B7

50
0F

4C
CD

FD
(4) Make suitable assumptions wherever necessary.

EB
30
C

9
A1
51

7
9

D8
B7

0F

4C
CD
95

2F
Q.1 (a) Compare linear and non-linear data structures. [05]

1F
30
C

9
30

51

F7

CE
9

D8
A
7
(b) Explain the advantage of circular queue over linear queue. Write a [05]

D
0E

95

CB

00

2F

94
C

1F
function in C language to insert an element in circular queue. B5

73

F7
9

D8
3

FA
5

D
(c) Define binary search tree. Discuss the case of deletion of a node in binary [05]

95

B
CE

00
1C
0

1F
C

72
B5

30
search tree if node has both the children.

73
94

D9

FA
5

0F
0E

95

CB
E
(d) Write a C function to search a node in doubly linked-list. [05]
D8

1C

30
C

72
5

30

A1
94

9
1F

55

0F
CD
E

CB
CE

2F
D8
FA

Q.2 (a) Construct AVL tree for the following sequence: [10]

09

30
5

F7
94

9
1F

55
72

B7
67,34,90,22,45,11,2,78,37,122

CD
E
E

00
8
FA

50

09
0F

C
D

(b) Write algorithm for postfix evaluation. Demonstrate the same step by step [10]

51

73
4

D9
F

EB

E3
30

9
for the expression: 9 6 7 * 2 / -
1

95
7

CB
8
A
B7

1C
50
F

4C
D

0
0

D9
F

EB

3
0
9C

5
72

89
A1

0E
73

95
Q.3 (a) Write a program to perform following operations on a circular linked list: [10]

1C
F

4C
CD

D
B

B5

30
0

i) insert a node from the end of the list, ii) delete first node,
0
C

55
2

9
A1

0E
51

CE
9

D8
B7

09
F

iii) count the number of nodes with even values, iv) display the list.
D
95

B5
00

2F

4
C

1F

E3
9C

(b) Write a C program to simulate linear queue as linked list. [10]


9
30

F7

CE
D8
A
5

50
D
0E

95

CB

00

4
C

1F

EB
2

89
B5

Q.4 (a) Construct Huffman tree and find the Huffman codes for each symbol [10]
0

51

73

7
D9
3

FA
F

4C
D
E

95

B
CE

given below with frequency of occurrence:


0
1C
0

1F
0
C

72

89
B5

30

73
94

Symbol p g e r i
9

FA
55

0F
CD

FD
0E

B
CE
D8

Frequency 20 17 33 25 40
0
C

72
5

A1
1

73
4

9
F

0F
9

CD
A1

(b) Explain the various ways to represent graph in the memory with example. [05]
5

B
CE

2F
D8

09

30
C
B5
2F

F7
94

9
1F

E3

55

B7
D
F7

00

(c) Construct binary search tree from given traversal sequences: [05]
8
FA

C
50

09
C

C
D
00

51

73
4

D9
F

In-order traversal D E B A C F G I H J
EB

3
2

9
A1

95
7

CB
8

C
0
0F

Pre-order F E D C B A G H I J
4C
FD

0
F

51

D9
B

3
30

traversal
89
A1

95
7

CE
7

1C
0
F

FD
CB

B5

30
0

2F

4
0

55

Q.5 (a) Apply linear probing to hash the following values in a hash table of size [10]
9
A1

0E
3

F7

CE
9

D8
B7

09
CD

11 and find the number of collisions: 67,44,90,12,83,52,23,87,79.


B5
00

2F

94
1F

E3
C

(b) Define topological sorting. Perform topological sorting for the following [10]
7

CE
D9

D8
A
B7

50
0F

graph:
94
1C

1F

EB
0
C

2
73

7
D9

8
FA
55

4C
FD
CB

00
C
9

72

89
30

A1
1

73
9
55

0F
CD

FD
0E

2F
9

0
C
0

A1
1

73

F7
9
E3

55

CD

2F
0

09

30
C

Q.6 (a) Construct a B tree of order 3 by inserting the following given elements as: [10]
B5

51

F7
9
E3

B7
CD

77,97,75,64,53,14,26,49,82,59.
95
CE

00
50

C
0

51

73

Show the B tree at each step of insertion.


94

D9
EB

E 3

95

CB
D8

(b) Write a function in C for DFS traversal of graph. Explain DFS graph [10]
C
0
4C

B5

30

51

D9

traversal with suitable example.


89

0E

95
CE

1C

_______________
FD

B5

30
4

55
89
A1

E
CE

50

09

12055 Page 1 of 1
FD
2F

94

EB

E3
A1
F7

D8

50
4C
2F

1F

EB
89
7

FA
0F

00F72FA1FD894CEB50E309551CD9CB73
4C
FD

You might also like