Daalab
Daalab
HYDERABAD
I Year M.Tech (CSE) I Semester
13.Write a C++ program to find optimal ordering of matrix multiplication. (Note: Use
Dynamic programming method).
14.Consider the problem of eight queens on an (8x8) chessboard. Two queens are said to
attack each other if they are on the same row, column, or diagonal. Write a C++ program
that implements backtracking algorithm to solve the problem i.e. place eight non-
attacking queens on the board.
15.Write a C++ program to find the strongly connected components in a digraph.
16.Write a C++ program to implement file compression (and uncompression) using
Huffman’s algorithm.
17.Write a C++ program to implement dynamic programming algorithm to solve the all
pairs shortest path problem.
18.Write a C++ program to solve 0/1 knapsack problem using the following:
a) Greedy algorithm.
b) Dynamic programming algorithm.
c) Backtracking algorithm.
d) Branch and bound algorithm.
19.Write a C++ program that uses dynamic programming algorithm to solve the optimal
binary search tree problem.
20.Write a C++ program for solving traveling sales persons problem using the following:
a) Dynamic programming algorithm.
b) The back tracking algorithm.
c) Branch and Bound.