CEC 05 : DESIGN AND ANALYSIS OF ALGORITHMS
Write the following programs using C / C++. Prepare a file containing codes/ programs of
this list with proper outputs i.e screen shots.
1. Sort the set of elements using insertion, selection, merge, quick, heap, radix, shell sort
methods and determine the time required to sort these elements. Repeat the
experiment for different values of n, the number of elements in the list and plot a
graph of time taken versus n. The elements should be generated using the random
number generator.
2. Search any element in the list using linear, binary and interpolation search methods.
3. Implement 0/1 knapsack problem using greedy approach and dynamic programming.
4. Generate optimal binary search tree and perform all the operations on binary search
trees.
5. Perform matrix multiplication using strassen’s matrix multiplication method.
6. Print all the nodes reachable from a given starting node in a digraph using BFS
method. Also check whether the graph is connected or not using DFS method.
7. Implement any scheme to find the optimal solution for travelling salesman problem
and then solve the same problem using any approximation algorithm and determine
the error in the approximation.
8. Implement all pair shortest path problem using Floyd’s algorithm.
9. Find the minimum cost spanning tree of a given undirected graph using Prim’s and
Kruskal’s algorithm.
10. Implement Bellman ford algorithm.
11. Generate the shortest path using Dijktra’s algorithm.
12. Generate a program to generate Huffman code.
Mrs. Veenu
COE department