Dsa Jan 2023
Dsa Jan 2023
:
PA-1239 [5925]-261
[Total No. of Pages : 3
1
S.E. (Computer Engineering)
2:1
DATA STRUCTURES AND ALGORITHMS
3:4
(2019 Pattern) (Semester-IV) (210252)
31
1/2 1
7
02
Time : 2½ Hours] [Max. Marks : 70
8 0 38
Instructions to the candidates:
4.3 01
1) Answer Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.
7/0
2) Neat diagrams must be drawn wherever necessary.
GP
3) Figures to the right indicate full marks.
4) Assume suitable data, if necessary.
3.1 CE
.18
Q1) a) Find minimum spanning tree of the following graph using kruskals
67
algorithm. [6]
:11
: 42
10
13
/01 71
23
8
/20
.38 13
0
07
7.1 GP
CE
84
6
:11
3.1
: 42
10
13
/01 71
23
b) Write algorithm for Breadth First Traversal of the graph. Also write its
8
/20
.38 13
complexity. [6]
0
c) Write Kruskal’s algorithm for minimum spanning trees and explain with
07
7.1 GP
example. [6]
CE
84
OR
6
3.1
10
P.T.O.
Q2) a) Apply Prim’s Algorithm to construct Minimum Spanning Tree, for below
drawn graph: Starting vertex is ‘a’. [6]
1
2:1
3:4
31
1/2 1
7
02
8 0 38
4.3 01
7/0
3.1 CE
67
.18
GP
:11
b) Develop pseudo code with one example to traverse a graph using BFS.
: 42
[6]
10
c) Find the shortest path from a to f, in the following graph using Dijkstra’s
13
Algorithm.
/01 71 [6]
23
8
/20
.38 13
0
07
7.1 GP
CE
84
6
:11
3.1
: 42
10
13
/01 71
Q3) a) What is OBST? List binary search tree with 3 words (w1, w2, w3) =
23
(do, if, stop) words occurs with probabilities (P1, P2, p3) = (0.4,0.5,0.1)
8
/20
b) Build AVL tree for given sequence of data. Show balance factor of all
0
07
nodes and name the rotation used for balancing the tree
7.1 GP
40,60,80,50,45,47,44,42,75,46,41. [6]
CE
OR
[5925]-261 2