Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Instruction : Answer any five questions taking atleast two from each
Part.
PART A
2. a) Write the Brute-force selection sort algorithm and obtain its time complexity. 10
b) Explain the assignment problem and give the optimal solution for the following
data, using Brute-force technique.
Jobs
J 1 J 2 J 3 J 4
P 1 8 7 1 0 5
Persons P 2 6 9 2 9
10
P 3 7 5 4 8
P 4 1 0 3 8 9
& %
)
*
# $
P.T.O.
EJ 1220 -2- *EJ1220*
4. a) Apply DFS to solve topological sorting problem for the following digraph. 10
b) Write the algorithm for BFS. Explain and show the order in which the nodes
are visited in the following graph using BFS. 10
PART B
I t e m W e i g h t V a l u e
! #
10
! #
# # #
7. a) Solve the following with node a as starting node using Prims algorithm.
! $ #
! "
$ "
$ & #
$ &
# " " #
b) Solve the single source shortest path problem using Dijkstras algorithm by
taking vertex a as the source. 10
8. a) Find the subset of a given set A = {1, 2, 5, 6, 8} and d = 9. Obtain its state
space tree using backtracking technique. 10
b) Apply the branch-and-bound algorithm to solve the travelling salesman
problem for the following graph. Show the state-space tree applied to the
graph. 10
______________