be_computer-engineering_semester-4_2022_november_data-structures-and-algorithms-dsa-pattern-2019
be_computer-engineering_semester-4_2022_november_data-structures-and-algorithms-dsa-pattern-2019
8
23
PA-1239 [5925]-261
[Total No. of Pages : 3
ic-
tat
S.E. (Computer Engineering)
5s
DATA STRUCTURES AND ALGORITHMS
6:1
(2019 Pattern) (Semester-IV) (210252)
02 91
3:4
0
Time : 2½ Hours] [Max. Marks : 70
31
7/0 13
Instructions to the candidates:
1) Answer Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.
0
1/2
2) Neat diagrams must be drawn wherever necessary.
.23 GP
8
C
23
Q1) a) Find minimum spanning tree of the following graph using kruskals
ic-
algorithm. [6]
16
tat
8.2
5s
.24
6:1
91
49
3:4
30
31
01
02
1/2
GP
7/0
CE
80
8
23
.23
ic-
16
tat
8.2
5s
.24
6:1
91
49
3:4
b) Write algorithm for Breadth First Traversal of the graph. Also write its
30
31
complexity. [6]
01
02
c) Write Kruskal’s algorithm for minimum spanning trees and explain with
1/2
GP
example. [6]
7/0
CE
80
.23
OR
16
8.2
.24
49
P.T.O.
Q2) a) Apply Prim’s Algorithm to construct Minimum Spanning Tree, for below
8
23
drawn graph: Starting vertex is ‘a’. [6]
ic-
tat
5s
6:1
02 91
3:4
0
31
7/0 13
0
1/2
.23 GP
E
80
8
C
23
ic-
16
tat
b) Develop pseudo code with one example to traverse a graph using BFS.
8.2
5s
[6]
.24
6:1
c) Find the shortest path from a to f, in the following graph using Dijkstra’s
91
49
Algorithm. [6]
3:4
30
31
01
02
1/2
GP
7/0
CE
80
8
23
.23
ic-
16
tat
8.2
5s
.24
6:1
91
Q3) a) What is OBST? List binary search tree with 3 words (w1, w2, w3) =
49
3:4
(do, if, stop) words occurs with probabilities (P1, P2, p3) = (0.4,0.5,0.1)
30
31
b) Build AVL tree for given sequence of data. Show balance factor of all
1/2
GP
nodes and name the rotation used for balancing the tree
7/0
40,60,80,50,45,47,44,42,75,46,41. [6]
CE
OR
.24
49
[5925]-261 2
Q4) a) Construct OBST for given data using dynamic programming approach.
8
23
Explain stepwise. [6]
ic-
Index 0 1 2 3
tat
Data 10 20 30 40
5s
Frequency 4 2 6 3
6:1
b) Demonstrate Deletion Operation in AVL with example. [6]
02 91
c) Explain following terms w.r.t. height balance tree LL, RR, LR, RL. [5]
3:4
0
31
Q5) a) Construct B-tree of order 4 by inserting the following data one at a time.
7/0 13
20, 10, 30, 15, 12, 40, 50 [6]
0
b) Write an algorithm to insert a node in B Tree. [6]
1/2
.23 GP
c) Construct the B+ Tree of order 4 for the following data: 1, 4, 7, 10, 17,
21, 31, 25, 19, 20, 28, 42. [6]
E
80
8
C
23
OR
ic-
16
tat
8.2
1, 42, 38, 21, 31, 10, 17, 7, 31, 25, 20, 18. [6]
5s
b) Write an algorithm to delete a node from B+tree. [6]
.24
6:1
91
c) Insert the keys to a 5-way B-tree:
49
3:4
3, 7, 9, 23, 45, 1, 5, 14, 25, 24, 13, 11, 08, 19, 04, 31, 35, 56 [6]
30
31
8
b) Compare sequential indexed sequential and direct access files. [6]
23
.23
tat
OR
8.2
5s
6:1
i) Add
91
49
3:4
ii) Delete
30
31
iii) Search
b) Explain any 3 operations carried out on sequentail file and its pseudo
01
02
code. [6]
1/2
GP
c) A file of employees records, has ‘employee no’ as primary key and the
7/0
.24
49
[5925]-261 3