You are on page 1of 2

BCA504P- ANALYSIS AND DESIGN OF ALGORITHM LAB

PART- A

1. Implement recursive binary search and linear search and determine the time required to search an
element. Record the time taken for the best case and worst case.

2. Write a program to find the maximum and minimum numbers in an array using the divide and conquer
technique. Record the time taken.

3. Sort a given set of elements using the quick sort method and determine the time required to sort the
elements. Repeat the experiment for different values of n, the number of elements in the 1st to be sorted
and plot a graph of the time taken versus n. The elements can be read from a file or can be generated
using the random number generator.

4. Implement the mergesort algorithm to sort a given set of elements and determine the time required to
sort the elements. Repeat the experiment for different values of n, the number of elements in the list to
be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be
generated using the random number generator.

5. Find Minimum Cost Spanning Tree of a given undirected graph using Prim’s algorithm.

6. Write a program to implement all pairs shortest path problem using Floyd’s algorithm.

7. Write a program to compute the transitive closure of a given directed graph using Warshall's algorithm.

8. From a given vertex in a weighted connected graph, find shortest paths to other vertices using Dijkstra's
algorithm.

9. Given a Binary tree, implement recursive in-order, pre-order and post-order tree traversals.

10. Write a program to check whether a given graph is connected or not using DFS method.

11. Find a subset of a given set S = {sl, s2,....., sn} of n positive integers whose sum is equal to a given
positive integer d. For example, if S= {1, 2, 5, 6, 8} and d = 9 there are two solutions {1, 2, 6} and
{1,8}.A suitable message is to be displayed if the given problem instance doesn't have a solution.

12. Write a program to implement the N Queens problem using back tracking.

PART – B

During practical examination the External and Internal examiners may prepare exam question paper related
to theory syllabus apart from Part-A. (A minimum of 8 Programs has to be prepared).

Note:
a) The candidate has to write two the programs One from Part-A and other from Part-B and execute one
program as of External examiner choice.
b) A minimum of 10 Programs has to be done in Part-B and has to be maintained in the Practical Record.
c) Scheme of Evaluation is as follows:
Writing two programs - 10 Marks
Execution of one program - 10 Marks
Formatting the Output - 05 Marks
Viva - 05 Marks
Record - 05 Marks
Total - 35 Marks

You might also like