CS3401 Set2
CS3401 Set2
Fourth Semester
(Regulations 2021)
1. Implement Linear Search. Determine the time required to search for an element. Repeat the
experiment for different values of n, the number of elements in the list to be searched and plot a
graph of the time taken versus n.
2. Write a program to implement binary search in C. Demonstrate the working of the algorithm with
suitable inputs and analyse its time complexity.
3. Sort a given set of elements using the Heap sort method and determine the time required to sort the
elements.
4. Write a program in C to multiply two matrices and analyse the time complexity of the algorithm for
different input sizes.
5. Write a C function that takes two string inputs – a longer text and a shorter text such that the
function should give the total number of occurrences of the pattern in the text string
6. Write a C program to implement the depth first search algorithm for a graph and analyse its time
complexity.
8. Find the minimum cost spanning tree of a given undirected graph using Prim’s algorithm.
10. Implement the merge sort algorithm in C and analyse its time complexity.
Page 1 of 2
11. Implement quick sort algorithm and analyse its time complexity.
12. Implement Traveling Salesperson problem and then solve the same problem instance using any
approximation algorithm and determine the error in the approximation.
13. Implement randomized algorithms for finding the kth smallest number.
14. Compute the transitive closure of a given directed graph using Warshall's algorithm.